/* =========================================================
   Portfolio — Sawad-inspired
   Black-warm background, white card, orange + neon-green accents.
   No gradients. Transparent boxes that reveal a soft grey on hover.
   ========================================================= */

:root {
  /* palette */
  --bg:            #161312;
  --bg-2:          #0e0c0b;
  --hover-bg:      rgba(255, 255, 255, 0.05);
  --hover-bg-2:    rgba(255, 255, 255, 0.08);
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);

  --text:          #ffffff;
  --muted:         #9a9a9a;
  --muted-2:       #6a6a6a;

  --accent:        #f46c38;    /* orange — main */
  --accent-2:      #c5ff41;    /* neon green — secondary */
  --accent-rgb:    244, 108, 56;
  --accent-2-rgb:  197, 255, 65;
  --accent-ink:    #0a0a0a;

  /* white profile-id card */
  --card-bg:       #ffffff;
  --card-text:     #0a0a0a;
  --card-muted:    #6a6a6a;

  /* layout tokens */
  --radius:        20px;
  --radius-sm:     12px;

  /* card transitions — long, smooth ease, like sawad */
  --ease:          cubic-bezier(0.22, 1, 0.36, 1);
  --t-card:        0.45s var(--ease);

  /* typography — Poppins, like sawad.framer.website */
  --font-sans:    "Poppins", system-ui, -apple-system, sans-serif;
  --font-display: "Poppins", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;
  --font-hand:    "Caveat", "Poppins", cursive;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* kill the dark grey tap highlight on mobile (iOS/Android) */
* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: auto; /* JS handles anchor scrolling with custom easing */ }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Lock scroll while the mobile menu is open. The .menu-open class is set
   on <body> by the JS toggle. Limited to mobile breakpoint so desktop
   isn't affected (the inline desktop menu doesn't need a scroll lock). */
@media (max-width: 760px) {
  body.menu-open {
    overflow: hidden;
    touch-action: none;
  }
}

/* faint graph-paper grid — only on the About page */
body.page-about {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><path d='M0 0L80 0M0 0L0 80' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='1'/></svg>");
  background-attachment: fixed;
  background-position: 0 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; }

/* When the browser jumps to an in-page anchor (e.g. arriving at
   index.html#projects from a cross-page link), this offset makes sure
   the section heading lands below the floating topnav instead of
   underneath it. The custom JS smooth-scroller already accounts for
   the same offset; this covers the native browser path. */
section[id] { scroll-margin-top: 100px; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- top nav (floating pill, glass + grain) ---------- */
.topnav {
  position: fixed;
  top: 18px;
  /* center without transform so descendants (mobile dropdown) can use
     backdrop-filter that composites against the page */
  left: 0;
  right: 0;
  margin-inline: auto;
  width: fit-content;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 14px 10px 18px;
  border-radius: 999px;
  background: rgba(22, 19, 18, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 10px 30px rgba(0, 0, 0, 0.35);
  isolation: isolate;
}
/* fractal-noise grain layer — subtle texture for the "glass" feel */
.topnav::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.55;
  mix-blend-mode: overlay;
  z-index: 0;
}
.topnav > * { position: relative; z-index: 1; }

.topnav__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.topnav__brand-mark {
  color: var(--accent);
  font-size: 1.1rem;
}

.topnav__menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topnav__link {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}
.topnav__link:hover { color: var(--text); background: var(--hover-bg); }
.topnav__link.is-active { color: var(--accent); }

.topnav__link--cta {
  color: var(--accent-ink);
  background: var(--accent);
}
.topnav__link--cta:hover {
  background: var(--accent);
  color: var(--accent-ink);
  filter: brightness(1.05);
}
/* keep the CTA pill readable when its section becomes active
   (otherwise orange text on orange bg = invisible) */
.topnav__link--cta.is-active {
  color: var(--accent-ink);
  background: var(--accent);
  filter: brightness(1.05);
}

.topnav__toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
  position: relative;
}
.topnav__toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  margin: 4px auto;
  border-radius: 2px;
  transition:
    transform 0.32s var(--ease),
    opacity 0.24s var(--ease);
}
/* When the menu is open (aria-expanded="true"), the three lines morph
   into an X: top line drops + rotates, middle collapses + fades,
   bottom rises + rotates. Eased both directions for a smooth swap. */
.topnav__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.topnav__toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.topnav__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- layout grid ---------- */
.layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 110px 100px 80px;
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 85px;
  align-items: start;
}

/* ---------- left: sticky profile column ---------- */
.profile {
  position: sticky;
  /* same as .layout's padding-top so the column doesn't drift up on scroll */
  top: 110px;
}

/* the outer wrapper — kept transparent so only the white head card
   reads as a visible block in the profile column */
.profile__card {
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  display: grid;
  gap: 14px;
}

/* the WHITE box that wraps the photo + body together */
.profile__head {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 18px 40px rgba(0, 0, 0, 0.45);
}

/* photo — inset inside the white head with 16px frame around it */
.profile__photo {
  position: relative;
  padding: 16px 16px 0;
  border-radius: 0;
  overflow: visible;
}
.profile__avatar,
.profile__photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 14px;
}

/* "Open to summer '26 internships" badge */
.profile__status {
  position: absolute;
  left: 28px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 14px;
  background: #ffffff;
  color: #0a0a0a;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.profile__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(var(--accent-2-rgb), 0.25);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-2-rgb), 0.40); }
  50%      { box-shadow: 0 0 0 8px rgba(var(--accent-2-rgb), 0); }
}

/* id-text — sits on the white .profile__head, no own background */
.profile__id {
  background: transparent;
  color: var(--card-text);
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}

/* .profile__body wraps id-text + tags + actions + socials inside the
   white head card so everything reads as one cohesive block */
.profile__body {
  padding: 16px 20px 18px;
  display: grid;
  gap: 12px;
  color: var(--card-text);
}
.profile__hand {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--card-muted);
  margin: 0 0 6px;
  display: block;
  transform: none;
}
.profile__name {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--card-text);
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.profile__role {
  margin: 0;
  color: var(--card-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.profile__tags {
  list-style: none;
  margin: 0;
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.profile__tags li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--card-muted);
}

.profile__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.profile__socials {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}
.profile__socials .iconlink {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--card-muted);
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.profile__socials .iconlink:hover { color: var(--accent); }

/* Resume (ghost) button on a white card needs dark contrasts */
.profile__body .btn--ghost {
  color: var(--card-text);
  border-color: rgba(0, 0, 0, 0.18);
  background: transparent;
}
.profile__body .btn--ghost:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--accent);
  color: var(--accent);
}

/* generic .iconlink (kept for footer) */
.iconlink {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.iconlink:hover { color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--hover-bg);
}
.btn--lg { padding: 14px 22px; font-size: 0.95rem; }

/* ---------- right column ---------- */
.content { min-width: 0; }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: 0 0 14px;
}

.hero { padding: 8px 0 64px; }

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 8vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  margin: 0 0 26px;
  font-weight: 800;
  text-transform: uppercase;
}
/* second line of any big heading — dim layered look, matches sawad */
.line-2 { color: #353334; }
/* solid orange — replaces the old gradient text */
.grad {
  color: var(--accent);
  background: none;
  -webkit-background-clip: initial;
          background-clip: initial;
}

.hero__lede {
  max-width: 60ch;
  font-size: 1.1rem;
  color: var(--muted);
  margin: 0 0 36px;
}

/* generic block */
.block {
  padding: 72px 0;
}
.block__title {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 8vw, 6rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  margin: 0 0 32px;
  font-weight: 800;
  text-transform: uppercase;
}
.block__lede {
  max-width: 60ch;
  color: var(--muted);
  margin: -10px 0 32px;
  font-size: 1.05rem;
}

/* ---------- card grids ---------- */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
#projects .cards { gap: 22px; }
.timeline { display: grid; gap: 4px; }
/* tools — 2 columns side-by-side */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* ---------- transparent cards w/ slight-grey hover ----------
   Default: transparent (no visible enclosure)
   Hover  : faint grey wash + lift + soft shadow, eased like sawad.
   Active : tiny press-in effect on click.
*/
.card,
.tile,
.now {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  will-change: transform;
  transition:
    background var(--t-card),
    border-color var(--t-card),
    transform var(--t-card),
    box-shadow var(--t-card);
}
@media (hover: hover) and (pointer: fine) {
  .card:hover,
  .tile:hover,
  .now:hover {
    background: var(--hover-bg);
    border-color: var(--border);
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  }
}
.card:active,
.tile:active,
.now:active {
  transform: translateY(0) scale(0.995);
  transition:
    transform 0.12s ease,
    background var(--t-card),
    box-shadow var(--t-card);
}

/* contact form — kept fully transparent (no hover enclosure) */
.form {
  background: transparent;
  border: 0;
  border-radius: var(--radius);
}

.card { display: block; overflow: hidden; }

/* project card — solid (no gradient) media tiles */
.card--project .card__media {
  aspect-ratio: 16 / 10;
  position: relative;
  background: #111111;
  border-radius: var(--radius);
  overflow: hidden;
}
/* optional photo inside .card__media — fills the area cleanly while
   keeping the bottom accent bar and badge on top */
.card__media-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card__media--1 { background: #2a1410; }
.card__media--1::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 4px;
  background: var(--accent);
}
.card__media--2 { background: #14200a; }
.card__media--2::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 4px;
  background: var(--accent-2);
}
.card__media--3 { background: #181410; }
.card__media--3::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 4px;
  background: #ffffff;
}

.card__badge {
  position: absolute;
  top: 12px; left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.78);
  color: var(--accent);
  z-index: 1;
}

.card__body { padding: 16px 18px 20px; }
.card__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 6px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card__sub {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.93rem;
}
.card__org {
  margin: 4px 0 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.card__date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.card--xp,
.card--note { padding: 20px 22px; }

/* bullet list inside experience cards — uses a custom marker so wrapped
   lines align with the start of the text, not under the bullet */
.card__bullets {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.93rem;
  display: grid;
  gap: 6px;
}
.card__bullets li {
  position: relative;
  padding-left: 1.25em;
}
.card__bullets li::before {
  content: "•";
  position: absolute;
  left: 0.15em;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}
/* a little breathing room between the bullets and the tag chips below */
.card__bullets + .tags { margin-top: 14px; }

.card--note .card__date {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
}
.card--sticker { background: transparent; }

.tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tags li {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border-strong);
}

/* tools / tiles — bigger, bolder names */
.tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border-radius: var(--radius-sm);
}
.tile__mark {
  width: 50px; height: 50px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #ffffff;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  color: var(--accent-ink);
  flex-shrink: 0;
  overflow: hidden;
}
.tile__mark img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  display: block;
}
.tile__name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.005em;
}
.tile__sub  { color: var(--muted); font-size: 0.88rem; }

/* ---------- contact form ---------- */
.form {
  padding: 4px 0 0;
  display: grid;
  gap: 16px;
}
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field { display: grid; gap: 6px; }
.field__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--text);
  background: #353334;
  border: 1px solid #353334;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  width: 100%;
  resize: vertical;
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(255, 255, 255, 0.42); }
.field input:hover,
.field select:hover,
.field textarea:hover {
  background: #3d3b3c;
  border-color: #3d3b3c;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: #353334;
}
.form__status {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  min-height: 1.2em;
}

/* Submit button — matches input height/font for a uniform field stack */
.form .btn {
  border-radius: 10px;
}
.form .btn--lg {
  padding: 8px 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  width: 100%;
  align-self: stretch;
}

/* ---------- "right now" card ---------- */
.now {
  padding: 22px 24px;
  display: grid;
  gap: 12px;
}
.now__head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.now__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(var(--accent-2-rgb), 0.20);
  animation: pulse 2s ease-in-out infinite;
}
.now__lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.now__lines li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: baseline;
  font-size: 0.98rem;
}
.now__lines b {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.now__lines span { color: var(--text); }
.now__lines em {
  color: var(--muted);
  font-style: normal;
}

/* ---------- "more about me" CTA ---------- */
.more { padding: 36px 0 12px; }
.more__link {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  transition: color 0.3s var(--ease);
}
.more__arrow {
  display: inline-flex;
  color: var(--accent);
  transition: transform 0.35s var(--ease), color 0.35s var(--ease);
  font-weight: 700;
  line-height: 1;
}
.more__link:hover { color: var(--accent); }
.more__link:hover .more__arrow {
  transform: translateX(8px);
}

/* ---------- footer ---------- */
.footer {
  padding: 24px 0 12px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* small handwritten note kept for personality (no gradients) */
.scribble {
  font-family: var(--font-hand);
  font-weight: 500;
  font-size: 1.45rem;
  color: var(--accent);
  line-height: 1;
  display: inline-block;
  transform: rotate(-3deg);
}

/* highlighter underline — solid orange, no gradient */
.mark {
  background-color: rgba(var(--accent-rgb), 0.30);
  padding: 0 4px;
  border-radius: 3px;
}

/* ---------- scroll-reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: transform, opacity;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .profile__status-dot,
  .now__dot { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .layout {
    padding: 100px 64px 72px;
    gap: 64px;
  }
  /* keep sticky aligned with the new padding-top so it doesn't drift */
  .profile { top: 100px; }
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 96px 24px 56px;
    gap: 32px;
  }
  .profile { position: static; }
  .profile__card {
    display: grid;
    gap: 18px;
    align-items: start;
  }
  /* center ONLY the section/hero headings + kicker on mobile;
     ledes and other content stay left-aligned */
  .hero__title,
  .block__title,
  .kicker { text-align: center; }

  /* equal vertical spacing between every section on mobile:
     hero ends with 32, every block starts and ends with 32 → 64px gap everywhere */
  .hero  { padding: 8px 0 32px; }
  .block { padding: 32px 0; }
  /* …but the "More about me" / "Back to home" CTA should sit close to,
     but not flush against, the footer separator */
  .more   { padding: 24px 0 14px; }
  .more__link { font-size: clamp(1.7rem, 8vw, 3rem); gap: 14px; }
  .footer { margin-top: 0; padding-top: 18px; }

  /* drop horizontal padding from card-like boxes so all body text
     starts at the same left margin as the section heading/lede */
  .card--xp,
  .card--note,
  .now      { padding-left: 0; padding-right: 0; }
  .card__body { padding-left: 0; padding-right: 0; }
  .card__bullets { padding-left: 0; }

  /* bigger techstack tiles + names — flush against the section's left edge */
  .tile { padding: 16px 0; gap: 18px; }
  .tile__mark { width: 60px; height: 60px; font-size: 1.35rem; border-radius: 14px; }
  .tile__mark img { width: 72%; height: 72%; }
  .tile__name { font-size: 1.2rem; }
  .tile__sub  { font-size: 0.92rem; }
  /* tighter gap between tiles on mobile */
  .grid { gap: 4px; }
}

@media (max-width: 760px) {
  .topnav { gap: 8px; padding: 8px 10px 8px 14px; }
  .topnav__toggle { display: block; }
  .topnav__menu {
    /* fixed + inset:0 + margin:auto centers in the viewport WITHOUT a
       persistent transform (transform would break the backdrop-filter glass) */
    position: fixed;
    inset: 0;
    margin: auto;
    width: fit-content;
    height: fit-content;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    /* glassier, more readable: denser surface + stronger blur so menu
       options are clearly visible against any background */
    background: rgba(22, 19, 18, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(36px) saturate(180%);
    -webkit-backdrop-filter: blur(36px) saturate(180%);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.05) inset,
      0 12px 36px rgba(0, 0, 0, 0.55);
    border-radius: 16px;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    min-width: 220px;
    isolation: isolate;
    /* Slide-in animation: closed = lifted + transparent, open = none.
       Critical: the open state uses `transform: none` (not translateY(0)),
       because identity transforms still create a containing block that
       breaks backdrop-filter compositing. The transform only exists during
       the brief transition, then disappears so the blur composites correctly. */
    display: flex;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.97);
    transform-origin: center;
    pointer-events: none;
    transition:
      opacity 0.32s var(--ease),
      transform 0.36s var(--ease),
      visibility 0s linear 0.36s;
  }
  .topnav__menu::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    overflow: hidden;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    opacity: 0.22;
    mix-blend-mode: overlay;
    z-index: 0;
  }
  .topnav__menu > * { position: relative; z-index: 1; }
  /* high-contrast link text inside the dropdown so options are clearly
     visible against the glassy backdrop */
  .topnav__menu .topnav__link {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 500;
  }
  .topnav__menu .topnav__link:hover,
  .topnav__menu .topnav__link.is-active {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.06);
  }
  .topnav__menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition:
      opacity 0.32s var(--ease),
      transform 0.36s var(--ease),
      visibility 0s linear 0s;
  }
  .topnav__link { padding: 10px 14px; }
}

@media (max-width: 560px) {
  .profile__head { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .form__row { gap: 10px; }
  .now__lines li { grid-template-columns: 1fr; gap: 2px; }
  /* keep footer row-aligned: scribble on left, "Back to top" on right */
  .footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    text-align: left;
  }
}


/* =========================================================
   ABOUT PAGE — bio + photo gallery with hover captions
   ========================================================= */

.about {
  max-width: 1100px;
  margin: 0 auto;
  padding: 130px 100px 80px;
  display: grid;
  gap: 64px;
}

.about__hero {
  display: grid;
  gap: 18px;
}
.about__title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 0;
  font-weight: 800;
  text-transform: uppercase;
}
.about__bio {
  display: grid;
  gap: 18px;
  max-width: 90ch;
  font-size: 1.08rem;
  color: var(--muted);
  line-height: 1.7;
}
.about__bio p { margin: 0; }

.about__sub {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin: 0 0 28px;
  font-weight: 800;
  text-transform: uppercase;
}

/* photo grid — mobile-first.
   2 columns, square by default; tiles can opt into spanning the full
   width (--full) or rendering as a landscape strip (--landscape). */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ph-tile {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #1a1815;
  display: block;
  isolation: isolate;
  aspect-ratio: 1 / 1;
  transition: transform var(--t-card), box-shadow var(--t-card);
}
.ph-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.ph-tile--full      { grid-column: span 2; }
.ph-tile--landscape { aspect-ratio: 16 / 9; }

/* Desktop (>960px) — explicit placement matching the requested layout:

   col 1     col 2       col 3      col 4
 ┌─────────┬───────────┬──────────┬──────────┐
 │   me    │  college  │   life   │          │  row 1
 │  tall   ├───────────┴──────────┼──────────┤
 │         │       childhood      │ weekend  │  row 2
 ├─────────┼───────────┬──────────┼──────────┤
 │hometown │ favourite │   tea    │          │  row 3
 ├─────────┴───────────┼──────────┴──────────┤
 │                     │       virgo         │  row 4
 └─────────────────────┴─────────────────────┘
*/
@media (min-width: 961px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 220px;
    gap: 12px;
  }
  /* let the grid drive heights */
  .ph-tile,
  .ph-tile--landscape { aspect-ratio: auto; }

  /* 1. selfie — vertical (col 1, rows 1-2) */
  .ph-tile:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; }
  /* 2. college — top row, col 2 */
  .ph-tile:nth-child(2) { grid-column: 2; grid-row: 1; }
  /* 3. life — top row, col 3 */
  .ph-tile:nth-child(3) { grid-column: 3; grid-row: 1; }
  /* 4. hometown — row 3 col 1 (left of favourite) */
  .ph-tile:nth-child(4) { grid-column: 1; grid-row: 3; }
  /* 5. favourite person — row 3 col 2 (right of hometown) */
  .ph-tile:nth-child(5) { grid-column: 2; grid-row: 3; }
  /* 6. childhood — horizontal, cols 2-3, row 2 */
  .ph-tile:nth-child(6) { grid-column: 2 / span 2; grid-row: 2; }
  /* 7. tea run — row 3 col 3 (right of favourite) */
  .ph-tile:nth-child(7) { grid-column: 3; grid-row: 3; }
  /* 8. me on weekends — col 4, row 2 (right of childhood) */
  .ph-tile:nth-child(8) { grid-column: 4; grid-row: 2; }
  /* 9. virgo — smaller landscape, on the left of row 4 (cols 1-2) */
  .ph-tile:nth-child(9) { grid-column: 1 / span 2; grid-row: 4; }
}

.ph-tile img,
.ph-tile__placeholder {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
}
.ph-tile:hover img,
.ph-tile:hover .ph-tile__placeholder {
  transform: scale(1.04);
  filter: brightness(0.85);
}

/* caption pill — hidden by default, slides in from the bottom-left on hover */
.ph-tile__caption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  pointer-events: none;
  z-index: 1;
}
.ph-tile:hover .ph-tile__caption,
.ph-tile:focus-visible .ph-tile__caption {
  opacity: 1;
  transform: translateY(0);
}

.about__hint {
  margin: 18px 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted-2);
  letter-spacing: 0.04em;
}
.about__hint code {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.78rem;
}

/* about page: pull the footer up so its gap to .more matches the home page
   (the .about grid otherwise injects an extra 64px between sections) */
.about > .footer { margin-top: -50px; }
.about .footer { padding-top: 12px; }

@media (max-width: 1180px) {
  .about { padding: 120px 64px 72px; }
}
@media (max-width: 960px) {
  .about {
    padding: 96px 24px 56px;
    /* drop the grid gap on mobile so the .more → .footer transition
       matches the home page (no extra space stacked on top of .more's
       own padding) */
    gap: 0;
  }
  /* re-introduce uniform spacing between the major sections */
  .about__hero,
  .about__gallery-wrap,
  .about > .more { margin-top: 40px; }
  .about > *:first-child { margin-top: 0; }
  .about > .footer { margin-top: 0; }

  .gallery { gap: 8px; }
  .about__title,
  .about__sub { text-align: center; }
  /* show captions always on mobile (touch devices don't really hover) */
  .ph-tile__caption {
    opacity: 1;
    transform: translateY(0);
  }
}
