/* Portfolio UI kit — extends colors_and_type.css with kit-level layout. */
@import url("colors_and_type.css");

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: var(--bg-base);
  color: var(--fg-1);
  font-family: var(--font-sans);
}

/* Nav pill — labels on wide screens, icons on narrow.
   Each pill link renders both a .pill-icon and a .pill-label; the breakpoint
   controls which is shown. The icon-only state tightens horizontal padding. */
.pill-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.pill-link .pill-icon  { display: none; line-height: 0; }
.pill-link .pill-label { display: inline; }

@media (max-width: 760px) {
  .pill-link .pill-icon  { display: inline-flex; }
  .pill-link .pill-label { display: none; }
  /* In icon mode, the nav glyphs match the theme toggle's 24px size. */
  .pill-link .pill-icon .icon {
    width: 24px !important;
    height: 24px !important;
  }
  /* In icon mode the chip styling falls away: no padding chip, no background,
     no shadow. The icon glyph itself changes color to indicate active. */
  .pill-link {
    padding: 6px !important;
    gap: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--fg-2) !important;
  }
  .pill-link:hover           { color: var(--fg-1) !important; }
  .pill-link.is-active       { color: var(--brand-text) !important; }
  .pill-link.is-active:hover { color: var(--brand-text) !important; }

  /* Pair the icon-mode pill with a 25% smaller logo. The wrapper keeps its
     full height so the smaller glyph stays vertically centered with the pill. */
  .logo-link svg,
  .logo-link img {
    width: 37.5px !important;
    height: 37.5px !important;
  }
}

/* Theme toggle — sliding track on tablet/desktop, plain icon button on mobile.
   Breakpoint matches the nav pill's icon/label switch (760px). */
.theme-slider  { display: inline-flex; }
.theme-slider-always { display: inline-flex; }
.theme-iconbtn { display: none; }
@media (max-width: 760px) {
  .theme-slider  { display: none; }
  .theme-iconbtn { display: grid; }
}

/* Page background: solid base with a dot grid. */
.page-bg {
  position: fixed; inset: 0;
  background: var(--bg-base);
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* — Subtle dot grid paper texture. — */
.page-bg .dot-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, rgba(237, 233, 254, 0.08) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: 0 0;
  z-index: 1;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 1;
}

/* — Icon helper — SVG via CSS mask so it picks up currentColor — */
.icon {
  display: inline-block;
  width: 20px; height: 20px;
  background-color: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  vertical-align: middle;
  flex-shrink: 0;
}

/* — Buttons — */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-weight: 600; font-size: 14px;
  padding: 11px 18px; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer; user-select: none;
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand-fill); color: var(--iris-50); }
.btn-primary:hover { background: var(--iris-900); }
.btn-primary:active { background: var(--iris-900); }
.btn-primary:hover:not(:active) { transform: translateY(-1px); }
.btn-primary .icon { transition: transform 320ms var(--ease-out); }
.btn-primary:hover .icon { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
  .btn-primary:hover:not(:active) { transform: none; }
  .btn-primary .icon, .btn-primary:hover .icon { transition: none; transform: none; }
}
.btn-accent  { background: var(--amber-500); color: #2A1A00; }
.btn-accent:hover  { background: var(--amber-400); color: var(--iris-900); }
.btn-accent:hover:not(:active) { transform: translateY(-1px); }
.btn-accent .icon { transition: transform 320ms var(--ease-out); }
.btn-accent:hover .icon { transform: translateX(-2px); }
@media (prefers-reduced-motion: reduce) {
  .btn-accent:hover:not(:active) { transform: none; }
  .btn-accent .icon, .btn-accent:hover .icon { transition: none; transform: none; }
}
.btn-secondary { background: #312B50; color: var(--iris-100); border-color: var(--border-default); }
.btn-secondary:hover { background: #3B345F; }
.btn-ghost { background: transparent; color: var(--fg-2); }
.btn-ghost:hover { background: rgba(237,233,254,0.06); color: var(--fg-1); }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 14px; }

/* — Nav pill: one indicator that slides between the active link — */
.pill-indicator {
  position: absolute; top: 6px; bottom: 6px; left: 0;
  border-radius: 999px;
  background: var(--brand-fill);
  transition: transform 420ms var(--ease-out), width 420ms var(--ease-out), opacity 220ms var(--ease-out);
  pointer-events: none;
}
@media (max-width: 760px) { .pill-indicator { background: var(--brand-soft); } }
@media (prefers-reduced-motion: reduce) { .pill-indicator { transition: none !important; } }

/* — Keyboard focus rings — */
.project-card:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .photo-img, .project-img, .project-card { transition: none !important; transform: none !important; }
}
.logo-link:focus-visible,
.pill-link:focus-visible,
.theme-slider:focus-visible,
.theme-iconbtn:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 3px; }

/* — Section heading scaffolding — */
.section { padding: clamp(28px, 4.5vw, 56px) 0; position: relative; z-index: 1; }

/* — Hero fills exactly one screen before scrolling —
   The in-flow header row (logo + theme toggle) is 98px tall (Nav's
   PILL_H 50 + 48), so the hero takes the remaining viewport height and
   centers its content vertically. dvh keeps it correct on mobile where the
   browser chrome changes the usable height; vh is the fallback. — */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 98px);
  min-height: calc(100dvh - 98px);
}

/* Bias the centered hero content upward so the nav-pill → eyebrow gap is ~40%
   tighter. The centered gap grows with viewport height, so the shift is a
   viewport-proportional translate (clamped at 0 so short screens never get
   pushed down). Purely visual — leaves the absolutely-positioned scroll hint
   and page height untouched. */
.hero .container {
  transform: translateY(min(0px, 112px - 20vh));
}

/* — Scroll-down hint: pinned to the bottom-centre of the hero (which fills the
     viewport). Minimal — a fading hairline above a thin chevron that drifts
     down with a gentle pulse. No boxed/round icon. — */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 2.4vh, 28px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 0 8px;
  color: var(--fg-3);
  text-decoration: none;
  z-index: 2;
  transition: opacity 240ms var(--ease-out), color var(--dur-base) var(--ease-out);
}
.scroll-hint:hover { color: var(--fg-1); }
.scroll-hint-line {
  width: 1px;
  height: 30px;
  background: linear-gradient(to bottom, transparent, currentColor);
  opacity: 0.5;
}
.scroll-hint-bob {
  display: grid;
  place-items: center;
  animation: scrollHintBob 1.8s ease-in-out infinite;
}
.scroll-hint-arrow {
  width: 11px;
  height: 11px;
  margin-top: -5px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  border-radius: 1px;
  transform: rotate(45deg);
}
@keyframes scrollHintBob {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  50%      { transform: translateY(5px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-hint-bob { animation: none; opacity: 0.85; }
}
.section-head { display: flex; flex-direction: column; gap: 5px; margin-bottom: clamp(18px, 2.2vw, 28px); }
.section-head h2 { margin: 0; }

/* — Reveal: subtle fade + 8px translate up — */
.reveal { opacity: 0; transform: translateY(8px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============================================================
   RESPONSIVE OVERRIDES
   All triggers ≤ 760px — matches the existing pill breakpoint.
   Wide layout (>760px, where the pill shows labels) is untouched.
   ============================================================ */

/* — Header row: the pill is fixed at top: 24px with height 50, so its vertical
     centerline is at y = 49. The in-flow row's min-height (98px = PILL_H + 48)
     places its center on the same line, keeping the logo + theme toggle
     vertically aligned with the pill at every breakpoint — including icon
     mode, where the logo glyph itself shrinks to 37.5px but its wrapper
     keeps the full 50px height to stay centered. — */

/* — About: stack portrait above caps; reduce caps columns. — */
@media (max-width: 880px) {
  .about-grid {
    grid-template-columns: 1fr !important;
  }
  .about-portrait {
    aspect-ratio: 16 / 10;
    min-height: 0 !important;
    max-height: 420px;
  }
  .about-caps {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 520px) {
  .about-portrait { aspect-ratio: 4 / 5; }
  .about-caps {
    grid-template-columns: 1fr !important;
  }
}

/* — Contact: stack the heading above the CTA; CTA fills width on mobile.
     Allow the long email button to wrap gracefully if needed. — */
@media (max-width: 720px) {
  .contact-grid {
    grid-template-columns: 1fr !important;
    align-items: flex-start !important;
  }
  .contact-cta {
    width: 100%;
    justify-content: center;
    white-space: normal;
    text-align: center;
    word-break: break-word;
  }
}
@media (max-width: 420px) {
  /* Tighten the contact email button so the email address doesn't
     overflow the rounded card on very narrow phones. */
  .contact-cta {
    font-size: 14px !important;
    padding: 12px 16px !important;
  }
}

/* — Project modal preview grid: only 2-col variant collapses to 1 on small screens. — */
@media (max-width: 720px) {
  .preview-grid-2 {
    grid-template-columns: 1fr !important;
  }
}

/* — Photography: masonry columns reduce on narrower screens. — */
@media (max-width: 880px) {
  .photo-grid { columns: 2 !important; }
}
@media (max-width: 560px) {
  .photo-grid { columns: 1 !important; }
}

/* — Section padding tightens on small screens to reduce dead vertical space. — */
@media (max-width: 520px) {
  .section { padding: 28px 0 !important; }
}

/* — Hero: tighten everything on small screens so it fits within
     a single iPhone 16 viewport (393×852) without being cut off. — */
@media (max-width: 520px) {
  /* Bias the content upward (more space reserved at the bottom) rather than
     dead-centering it, and leave room for the scroll hint. */
  .hero {
    justify-content: flex-start !important;
    padding: clamp(44px, 12vh, 110px) 0 96px !important;
  }
  .hero-eyebrow {
    margin-bottom: 16px !important;
    font-size: 18px !important;
  }
  .hero-headline {
    font-size: 44px !important;
    line-height: 1.03 !important;
    letter-spacing: -0.024em !important;
  }
  .hero-lede {
    margin-top: 16px !important;
    font-size: 17px !important;
    line-height: 1.5 !important;
    max-width: 30ch !important;
  }
  /* Keep the two CTAs side by side at their natural widths. */
  .hero-ctas {
    margin-top: 24px !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
  .hero-ctas .btn-lg {
    width: auto !important;
    max-width: none !important;
    justify-content: center !important;
    padding: 12px 18px !important;
    font-size: 14px !important;
    border-radius: 12px !important;
    min-height: 46px !important;
  }
  .hero-meta {
    margin-top: 26px !important;
    gap: 10px 16px !important;
    font-size: 12px !important;
  }
}

/* ============================================================
   LIGHT MODE OVERRIDES — kit-level
   Only inside [data-theme="light"]; dark mode untouched.
   ============================================================ */

/* Dot grid: switch to dark dots multiplied over the light page. */
:root[data-theme="light"] .page-bg .dot-grid {
  background-image: radial-gradient(circle at 1px 1px, rgba(159, 142, 223, 0.18) 1px, transparent 1px);
}

/* About section: drop the dark vignette gradient on the light page. */
:root[data-theme="light"] #about {
  background: none !important;
}

/* Secondary button: dark iris text on soft purple. */
:root[data-theme="light"] .btn-secondary {
  color: var(--iris-900);
  background: #EEEAFA;
  border-color: var(--border-default);
}
:root[data-theme="light"] .btn-secondary:hover {
  background: #E2DAF5;
}

/* Contact card: hardcoded dark gradient — swap to a light one. */
:root[data-theme="light"] .contact-wrap {
  background: linear-gradient(135deg, #FFFFFF 0%, #ECE6FA 100%) !important;
  border: 1px solid var(--border-default) !important;
}
:root[data-theme="light"] .contact-wrap p {
  color: var(--fg-2);
}

/* Hero amber accent: amber-500 is too pale on white — deepen for contrast. */
:root[data-theme="light"] .hero-amber {
  color: var(--amber-700) !important;
}

/* Project modal tags: iris-100 is invisible on light bg — use iris-700. */
:root[data-theme="light"] .pm-tag {
  color: var(--iris-700) !important;
  background: rgba(138, 114, 214, 0.12) !important;
}

/* — Large screens (≥1240px): the hero's fluid type and the inline lede size
     bottom out around the old 1240px container width, so on 27"+ monitors the
     headline stopped growing and the section read as empty. Resume fluid
     scaling from where the small/medium tiers leave off, climbing toward a
     ~2560px ceiling. !important is required because the sizes are set as inline
     React styles. Nothing below 1240px is affected. — */
@media (min-width: 1240px) {
  .hero {
    min-height: calc(100vh - 98px);
    min-height: calc(100dvh - 98px);
  }
  .hero-eyebrow {
    font-size: clamp(34px, calc(23px + 0.91vw), 46px) !important;
    margin-bottom: clamp(24px, 2.2vw, 34px) !important;
  }
  .hero-headline {
    font-size: clamp(82px, calc(50px + 2.58vw), 116px) !important;
    max-width: 1200px !important;
  }
  .hero-lede {
    font-size: clamp(19px, calc(14px + 0.38vw), 24px) !important;
    max-width: clamp(640px, 48vw, 760px) !important;
    line-height: 1.55 !important;
  }
  .hero-ctas {
    margin-top: clamp(36px, 3.4vw, 52px) !important;
  }
  .hero-meta {
    margin-top: clamp(48px, 4.4vw, 68px) !important;
    font-size: clamp(13px, calc(11px + 0.16vw), 16px) !important;
  }
}



/* — About, desktop: each capability is title, horizontal divider, description — */
@media (min-width: 881px) {
  #about .about-caps > li { border-top: 0 !important; padding: 0 0 32px !important; }
  #about .about-caps h3 { padding-bottom: 12px; border-bottom: 1px solid var(--border-default); }
  #about .about-caps p { padding-top: 12px; }
}

/* — Desktop type sizes: About capability titles and descriptions, and the contact line — */
@media (min-width: 881px) {
  #about .about-caps h3 { font-size: 22px !important; }
  #about .about-caps p { font-size: 18px !important; }
  #contact p { font-size: 18px !important; }
}

/* — Section anchors: land each section's title just below the floating nav — */
#work, #photography, #about { scroll-margin-top: calc(98px - clamp(28px, 4.5vw, 56px)); }
