/* anashaddadfit.com: the home page (/ and /ar/). Loaded after site.css, which
   supplies the fonts, colour tokens, glow, grain and the top bar.
   Mobile first, text-led: big type, calm spacing, one thought per screen. */

.home {
  --wrap: 560px;
  --sec: 96px;
}

/* ---------- Opening ---------- */
.hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(70svh - 60px);
  padding: 28px 0 0;
}
.avatar {
  position: relative;
  display: block;
  width: 88px;
  height: 88px;
  margin-bottom: 28px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(207, 143, 46, 0.55), 0 0 0 7px rgba(207, 143, 46, 0.08), 0 18px 50px rgba(207, 143, 46, 0.16);
}
.avatar img {
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
}
.hero h1 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(2.9rem, 13.6vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.hero-line {
  max-width: 22ch;
  margin: 22px 0 0;
  color: var(--ink);
  font-size: clamp(1.3rem, 5.6vw, 1.6rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.hero-sub {
  max-width: 30ch;
  margin: 10px 0 0;
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.5;
  text-wrap: balance;
}
.btn-ig {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  align-self: flex-start;
  min-height: 56px;
  margin-top: 34px;
  padding: 0 28px 0 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  transition: transform var(--t-fast) ease, background var(--t-fast) ease;
}
.btn-ig svg {
  width: 22px;
  height: 22px;
}
@media (hover: hover) {
  .btn-ig:hover {
    background: #fff;
  }
}
.btn-ig:active {
  transform: scale(0.97);
}
.btn-ig:focus-visible {
  border-radius: 999px;
}

/* Prepared for the large real photo (see the comment in the page). With a
   <picture class="hero-photo"> inside, add class "has-photo" to .hero: the
   photo fills the top of the screen and the text sits on its faded bottom. */
.hero.has-photo {
  justify-content: flex-end;
  min-height: 92svh;
  padding-top: 0;
}
.hero-photo {
  position: absolute;
  inset: 0 0 auto;
  height: 74%;
  z-index: -1;
}
.hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14, 14, 14, 0) 45%, var(--bg) 100%);
}
.hero.has-photo .avatar {
  display: none;
}

/* ---------- Sections ---------- */
.sec {
  padding: var(--sec) 0 0;
}
.sec h2 {
  margin: 0;
  font-weight: 600;
  font-size: clamp(1.75rem, 7.6vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
/* Amber full stop after the section titles, like the sticker's "You looked." */
.sec .kicker::after,
.dot {
  color: var(--acc);
}
.sec .kicker::after {
  content: ".";
}
/* A short amber rule marks the start of each titled section */
.sec .kicker::before {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin-bottom: 22px;
  border-radius: 2px;
  background: var(--acc);
}

/* "You've probably tried before." */
.relate .statement {
  font-size: clamp(2.3rem, 10.6vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.relate .story {
  margin: 30px 0 0;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.55;
}
.relate .story span,
.relate .turn > span {
  display: block;
}
.relate .story span + span {
  margin-top: 14px;
}
.relate .turn {
  margin: 56px 0 0;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.55;
}
.relate .turn strong {
  display: block;
  margin-bottom: 16px;
  color: var(--ink);
  font-weight: 600;
  font-size: clamp(2rem, 9.2vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

/* How I think: three short cards */
.ways {
  counter-reset: way;
  display: grid;
  gap: 12px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}
.way {
  padding: 22px 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(245, 241, 234, 0.025), rgba(245, 241, 234, 0)), var(--card);
}
.way::before {
  counter-increment: way;
  content: counter(way, decimal-leading-zero);
  display: block;
  margin-bottom: 14px;
  color: var(--acc);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}
.way h3 {
  margin: 0;
  font-weight: 600;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.way p {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.55;
}

/* About me: text now, a training photo later (see the comment in the page).
   With a <picture class="about-photo"> added, add class "has-photo" to
   .about-body: phones stack it above the text, wide screens put it beside. */
.about-body {
  display: grid;
  gap: 28px;
  margin-top: 28px;
}
.about-text p {
  margin: 0;
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.7;
}
.about-text p + p {
  margin-top: 18px;
}
.about-text .lead {
  display: block;
  margin-bottom: 18px;
  color: var(--ink);
  font-size: clamp(1.3rem, 5.6vw, 1.55rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
}
.about-photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-lg);
}

/* Tools: two tappable tiles */
.tools .intro {
  margin: 12px 0 0;
  color: var(--ink-2);
  font-size: 17px;
}
.tiles-nav {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}
.tool {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 96px;
  padding: 18px 16px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  transition: transform var(--t-fast) ease, background var(--t-fast) ease, border-color var(--t-fast) ease;
}
.tool .ic {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  align-self: flex-start;
  border-radius: 14px;
  background: var(--tile);
}
.tool .ic svg {
  width: 24px;
  height: 24px;
}
.tool .txt {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.tool .t {
  font-weight: 600;
  font-size: 17px;
  line-height: 1.3;
}
.tool .s {
  color: var(--mut);
  font-size: 14.5px;
  line-height: 1.45;
}
.tool .go {
  flex: 0 0 20px;
  color: var(--mut);
  transition: transform var(--t-fast) ease, color var(--t-fast) ease;
}
.tool .go svg {
  display: block;
  width: 20px;
  height: 20px;
}
[dir="rtl"] .tool .go svg {
  transform: scaleX(-1);
}
@media (hover: hover) {
  .tool:hover {
    background: var(--card-on);
    border-color: var(--line-2);
  }
  .tool:hover .go {
    color: var(--ink);
    transform: translateX(2px);
  }
  [dir="rtl"] .tool:hover .go {
    transform: translateX(-2px);
  }
}
.tool:active {
  transform: scale(0.98);
  background: var(--card-on);
}
.tool:focus-visible {
  border-radius: 22px;
}

/* ---------- Footer (styles in site.css, .page-foot) ---------- */
.home .page-foot {
  margin-top: var(--sec);
}

/* ---------- Arabic ---------- */
[dir="rtl"] .hero h1,
[dir="rtl"] .sec h2,
[dir="rtl"] .hero-line,
[dir="rtl"] .relate .turn strong,
[dir="rtl"] .about-text .lead,
[dir="rtl"] .way h3 {
  letter-spacing: 0;
}
[dir="rtl"] .hero h1 {
  line-height: 1.2;
  font-size: clamp(2.7rem, 12.6vw, 4.3rem);
}
[dir="rtl"] .hero-line {
  line-height: 1.5;
}
[dir="rtl"] .sec h2 {
  line-height: 1.35;
}
[dir="rtl"] .relate .statement {
  line-height: 1.3;
}
[dir="rtl"] .relate .story,
[dir="rtl"] .relate .turn,
[dir="rtl"] .way p,
[dir="rtl"] .about-text p {
  line-height: 1.8;
}
[dir="rtl"] .about-text .lead {
  line-height: 1.6;
}
[dir="rtl"] .relate .turn strong {
  line-height: 1.35;
}
[dir="rtl"] .tool {
  padding: 18px 18px 18px 16px;
}
[dir="rtl"] .btn-ig {
  padding: 0 24px 0 28px;
}

/* ---------- Motion ----------
   The opening rises in on load (CSS only). Sections further down fade in as
   they scroll into view: reveal.js adds .wait to the ones still off screen,
   then .in when they arrive. Without JavaScript nothing is hidden. Both only
   run without a reduced-motion preference. */
@keyframes home-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .hero .rise {
    animation: home-in 520ms var(--ease) both;
  }
  .hero .rise:nth-child(2) { animation-delay: 60ms; }
  .hero .rise:nth-child(3) { animation-delay: 120ms; }
  .hero .rise:nth-child(4) { animation-delay: 170ms; }
  .hero .rise:nth-child(5) { animation-delay: 220ms; }
  [data-reveal].wait {
    opacity: 0;
    transform: translateY(18px);
  }
  [data-reveal].wait.in {
    opacity: 1;
    transform: none;
    transition: opacity 760ms ease, transform 900ms var(--ease);
  }
}

/* ---------- Wider screens ---------- */
@media (min-width: 700px) {
  .home {
    --sec: 128px;
  }
  .hero {
    min-height: calc(80svh - 84px);
  }
  .about-body.has-photo {
    grid-template-columns: 0.8fr 1fr;
    align-items: start;
  }
}
