/* About me: one section title over four cards (Summary, Experience, Education, Awards).
   Desktop (>=1025px): a 2x2 grid that fits inside one 100svh screen.
   Below that: one card per row, natural scrolling.
   Sits on cream #F5F0E8 (--editorial-bg) in light and #19150F in dark. The cards keep that
   same fill on purpose: Creative's MP4 plates (WebKit) and posters are keyed to it, so only a
   hairline border separates a card from the section.
   The earlier full-height alternating layout lives in git history (see 2c1300a). */

:root,
[data-theme="light"]{
  --editorial-bg:#F5F0E8;
  --about-bg:var(--editorial-bg);
  --about-rule:rgba(42,32,21,.14);
  --about-card-line:rgba(42,32,21,.2);
}

[data-theme="dark"]{
  --about-bg:#19150F;
  --about-rule:rgba(248,241,226,.14);
  --about-card-line:rgba(248,241,226,.2);
}

#about.about-me{
  background:var(--about-bg);
  color:var(--ink-2);
  padding:clamp(20px,3.4svh,40px) 0;
  border-top:0;
  overflow-x:clip;
  /* Desktop fit: the section is exactly one screen; see the >=1025px block. */
  --about-gap:clamp(16px,2.2svh,24px);
  --about-fig-h:300px;
  --about-pad:clamp(14px,2svh,20px);
}

#about.about-me .about-me__wrap{
  width:min(1320px,100% - 48px);
  margin-inline:auto;
}

/* Same heading style as the other section titles (global h2 + .rule). */
#about.about-me .about-me__head{
  margin-bottom:var(--about-gap);
}

#about.about-me .about-me__head h2:focus{
  outline:none;
}

#about.about-me .about-me__head h2:focus-visible{
  outline:2px solid var(--focus,#1d5fc8);
  outline-offset:6px;
}

#about.about-me .about-me__head .rule{
  margin-top:12px;
}

#about.about-me .about-cards{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:var(--about-gap);
}

/* ---- Card ---- */
#about.about-me .about-block{
  min-width:0;
  border:1px solid var(--about-card-line);
  border-radius:8px;
  background:var(--about-bg);
  overflow:hidden;
}

#about.about-me .about-block__inner{
  height:100%;
  display:grid;
  grid-template-columns:calc(var(--about-fig-h) * .8) minmax(0,1fr);
  grid-template-rows:auto 1fr;
  column-gap:clamp(12px,1.2vw,18px);
  row-gap:clamp(6px,1.2svh,12px);
  align-items:stretch;
  padding:var(--about-pad) clamp(16px,1.6vw,24px) 0 clamp(8px,1vw,16px);
}

#about.about-me .about-block__media{
  grid-column:1;
  grid-row:2;
  align-self:start;
  width:calc(var(--about-fig-h) * .8);
  height:var(--about-fig-h);
  min-width:0;
}

/* The text wrappers are flattened so the card title (.about-kicker) can span the top of the
   card, above the figure, and the body sits to the right of the figure, top-aligned under it. */
#about.about-me .about-block__text,
#about.about-me .about-block__copy{
  display:contents;
}

#about.about-me .about-block__copy > :not(.about-kicker){
  grid-column:2;
  grid-row:2;
  min-width:0;
  align-self:start;
  margin-bottom:var(--about-pad);
}

#about.about-me .label{
  color:var(--quiet);
}

#about.about-me .about-block h3{
  color:var(--ink);
  font-size:clamp(1.25rem,1rem + .55vw,1.5rem);
  line-height:1.2;
}

#about.about-me .about-kicker{
  grid-column:1 / -1;
  grid-row:1;
  /* the figure column has its own built-in margin, so inset the title to the card's text padding */
  margin-left:calc(clamp(16px,1.6vw,24px) - clamp(8px,1vw,16px));
  display:flex;
  flex-direction:column;
  gap:6px;
}

#about.about-me .about-kicker .rule{
  width:40px;
  height:3px;
  margin:4px 0 0;
  border:0;
  background:var(--primary);
}

#about.about-me .lede-about{
  font-size:16px;
  line-height:23px;
  color:var(--ink);
  max-width:46ch;
}

#about.about-me .rows{
  list-style:none;
  margin:0;
  padding:0;
}

#about.about-me .rows li{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  grid-template-areas:"main when";
  column-gap:12px;
  row-gap:0;
  align-items:start;
  padding:7px 0;
  border-top:1px solid var(--about-rule);
}

#about.about-me .rows li > div{
  grid-area:main;
  min-width:0;
}

#about.about-me .rows li:first-child{
  border-top:0;
  padding-top:0;
}

#about.about-me .rows li:last-child{
  padding-bottom:0;
}

#about.about-me .rows .when{
  grid-area:when;
  justify-self:end;
  font:500 12px/16px "JetBrains Mono",monospace;
  letter-spacing:.02em;
  color:var(--quiet);
  padding-top:3px;
  text-align:right;
  white-space:nowrap;
}

#about.about-me .rows h4{
  font:600 16px/22px "Hanken Grotesk",sans-serif;
  color:var(--ink);
  text-wrap:pretty;
}

#about.about-me .rows p{
  font-size:15px;
  line-height:20px;
  color:var(--ink-2);
}

/* ---- Figure: 4:5 box, bottom-aligned, soft bottom fade (~12%) ---- */
#about.about-me .about-media{
  margin:0;
  position:relative;
  width:100%;
  height:100%;
  background:transparent;
  overflow:hidden;
}

#about.about-me #summary .about-media,
#about.about-me #awards .about-media,
#about.about-me #education .about-media,
#about.about-me #experience .about-media{
  -webkit-mask-image:linear-gradient(to bottom,#000 88%,transparent 100%);
  mask-image:linear-gradient(to bottom,#000 88%,transparent 100%);
  -webkit-mask-size:100% 100%;
  mask-size:100% 100%;
  -webkit-mask-repeat:no-repeat;
  mask-repeat:no-repeat;
}

#about.about-me .about-media video,
#about.about-me .about-media img,
#about.about-me .about-media picture{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:center bottom;
  background:transparent;
}

#about.about-me .about-media picture{
  position:absolute;
  inset:0;
}

#about.about-me .about-media.is-playing picture{
  opacity:0;
  pointer-events:none;
}

#about.about-me .about-media video{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
}

/* Education, dark theme: the mortarboard is near-black on #19150F. A faint warm rim light and
   soft lift, drawn from the figure's own alpha by a CSS filter (no extra shapes or assets), keeps it legible.
   (WebKit plays an opaque on-bg MP4, so the filter has no alpha to follow there.) */
[data-theme="dark"] #about.about-me #education .about-media picture,
[data-theme="dark"] #about.about-me #education .about-media video{
  filter:drop-shadow(0 0 1px rgba(244,192,102,.75)) drop-shadow(0 0 7px rgba(244,192,102,.22));
}

/* Mentors: hidden behind a flag. Do not delete. Enable with html[data-show-about-mentors] or SHOW_ABOUT_MENTORS. */
#about.about-me .about-mentors{
  display:none;
  width:min(1320px,100% - 48px);
  margin:0 auto;
  padding:0 0 48px;
}

html[data-show-about-mentors] #about.about-me .about-mentors{
  display:block;
}

#about.about-me .mentors{
  display:grid;
  gap:24px;
  margin-top:16px;
}

#about.about-me .mentor{
  display:grid;
  gap:8px;
  padding-top:16px;
  border-top:1px solid var(--about-rule);
}

#about.about-me .mentor a{
  font:500 14px/20px "Hanken Grotesk",sans-serif;
  color:var(--accent);
  min-height:44px;
  display:inline-flex;
  align-items:center;
  gap:8px;
}

/* Motion: transform + opacity only. JS sets data-about-motion when motion is allowed. */
@media (prefers-reduced-motion:no-preference){
  #about.about-me[data-about-motion] .about-block{
    opacity:0;
    transform:translateY(24px);
  }

  #about.about-me[data-about-motion] .about-block.is-in{
    animation:about-settle .7s cubic-bezier(.22,1.22,.36,1) forwards;
  }
}

@keyframes about-settle{
  from{opacity:0;transform:translateY(24px)}
  to{opacity:1;transform:translateY(0)}
}

/* ---- Stacked (<=1024px): one card per row, figure above the text ----
   Each card opens with its animation: the figure is centred at ~58% of the card width
   (4:5 box, capped so it never gets huge on tablets), then the copy follows. */
@media (max-width:1024px){
  #about.about-me{
    padding:56px 0 40px;
    --about-gap:20px;
    --about-pad:20px;
  }

  #about.about-me .about-block__inner{
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:none;
    row-gap:0;
    padding:var(--about-pad) 24px 0;
  }

  /* order: title, figure, text */
  #about.about-me .about-kicker{
    margin-left:0;
    margin-bottom:14px;
  }

  #about.about-me .about-block__media{
    grid-column:1;
    grid-row:2;
    justify-self:center;
    align-self:start;
    width:min(55%,320px);
    height:auto;
    aspect-ratio:4/5;
  }

  #about.about-me .about-media{
    height:auto;
    aspect-ratio:4/5;
  }

  #about.about-me .about-block__copy > :not(.about-kicker){
    grid-column:1;
    grid-row:3;
    padding-top:4px;
    margin-bottom:var(--about-pad);
  }
}

@media (max-width:640px){
  #about.about-me{
    padding:40px 0 24px;
  }

  #about.about-me .about-me__wrap,
  #about.about-me .about-mentors{
    width:calc(100% - 32px);
  }

  #about.about-me .about-block__inner{
    padding:16px 20px 0;
  }

  /* ~57% of the card width (the grid cell is the card minus its 20px padding),
     and at most 208px wide = 260px tall in the 4:5 box. */
  #about.about-me .about-block__media{
    width:min(65%,208px);
  }
}

/* Very narrow phones (420px and below, inclusive): the date drops onto its own line under the role/degree title, so
   the title and the place use the full text width. (The row's div is flattened so the date can
   sit between its h4 and p.) */
@media (max-width:420px){
  #about.about-me .rows li{
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"title" "when" "meta";
  }

  #about.about-me .rows li > div{
    display:contents;
  }

  #about.about-me .rows li h4{
    grid-area:title;
  }

  #about.about-me .rows li p{
    grid-area:meta;
  }

  #about.about-me .rows .when{
    justify-self:start;
    text-align:left;
    padding-top:0;
    margin:2px 0 3px;
  }
}

/* ---- Desktop: 2x2, one screen ---- */
@media (min-width:1025px){
  #about.about-me{
    min-height:100svh;
    display:flex;
    flex-direction:column;
    justify-content:center;
    /* Figure scales with the screen height, then caps. */
    --about-fig-h:clamp(240px,31svh,420px);
  }

  #about.about-me .about-cards{
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:stretch;
  }
}

/* Experience now lists six roles. On the desktop 2x2 only, its rows get tighter spacing and
   line-height (text stays 16px titles / 15px places) so the whole grid still fits one screen. */
@media (min-width:1025px){
  #about.about-me #experience .rows li{
    padding:3px 0;
  }

  #about.about-me #experience .rows li:first-child{
    padding-top:0;
  }

  #about.about-me #experience .rows li:last-child{
    padding-bottom:0;
  }

  #about.about-me #experience .rows h4{
    line-height:19px;
  }

  #about.about-me #experience .rows p{
    line-height:18px;
  }

  #about.about-me #experience .rows .when{
    padding-top:2px;
    letter-spacing:0;
  }

  /* A slightly narrower date column keeps "SDE-2 (Acting Product Manager)" on one line at 1440. */
  #about.about-me #experience .rows li{
    column-gap:8px;
  }
}

/* Narrow desktop (1025-1279px): cards are ~480px wide, so shrink the figure and put each
   date on its own line above the row so the text column keeps a readable width. */
@media (min-width:1025px) and (max-width:1279px){
  #about.about-me{
    --about-fig-h:clamp(200px,28svh,250px);
  }

  #about.about-me .rows li{
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"when" "main";
  }

  #about.about-me .rows .when{
    justify-self:start;
    text-align:left;
    padding-top:0;
  }
}

@media (min-width:1920px){
  #about.about-me .about-me__wrap,
  #about.about-me .about-mentors{
    width:min(1440px,100% - 80px);
  }
}
