/* yacine.design: shared styles (static HTML phase) */

/* Aileron (Sora Sagano, public domain, "No Rights Reserved"): 400 and 700, self-hosted Latin WOFF2 subsets.
   No Medium exists: 500 renders with the Regular, 600 with the Bold. Aileron has no arrow glyphs,
   so arrows (→) fall back to the system font. */
@font-face {
  font-family: "Aileron";
  src: url("../assets/fonts/aileron-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Aileron";
  src: url("../assets/fonts/aileron-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #e9e6e0;
  --card: #f3f1ec;
  --stage: #dcd8d0;
  --ink: #1f1e1c;
  --body: #4a4946;
  --grey: #7d7a74;
  --rule: #c8c4bb;
  --night: #232220;
  --night-ink: #efece6;
  --night-grey: #9a968e;
  --accent: #f0683a;

  --frame: 1200px;
  --inset: clamp(20px, 4.2vw, 60px);
  --radius: 20px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --font: "Aileron", system-ui, -apple-system, sans-serif;
  /* Type scale, after arronhunt.com: 18 body, then 21 / 27 / 34 / 55 / display */
  --fs-body: 18px;
  --fs-h4: 21px;
  --fs-section: 27px;
  --fs-h3: 34px;
  --fs-h2: clamp(34px, 3.2vw + 10px, 55px);
  --fs-display: clamp(34px, 6.35vw + 8px, 89px);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--body);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; }
img, video, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 700; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }

.skip {
  position: absolute; left: 12px; top: 12px; z-index: 10;
  padding: 10px 16px; background: var(--ink); color: var(--paper); border-radius: 99px;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

.frame { width: min(100%, var(--frame)); margin-inline: auto; padding-inline: var(--inset); }

/* Header: logo left, the links centered, Contact as a dark pill on the right.
   Not sticky: it scrolls away with the page. */
.site-header {
  --menu-gap: clamp(20px, 2.4vw, 36px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: var(--menu-gap);
  min-height: 96px; padding-top: 16px; font-size: 16px; font-weight: 500; letter-spacing: -.005em;
}
.site-header > a:first-child img { display: block; width: 92px; height: auto; }
.site-header nav { display: flex; align-items: center; gap: var(--menu-gap); }
.site-header nav a { color: var(--body); transition: color .2s var(--ease); }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--ink); }
.header-contact {
  justify-self: end; display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px;
  border-radius: 99px; background: var(--ink); color: var(--paper);
  transition: background-color .2s var(--ease), translate .25s var(--ease);
}
.header-contact:hover { background: #000; translate: 0 -1px; }

/* Arrival: the logo fades in while the menu items drop in from above, left to right, 60ms apart.
   Plays on the first page of a visit and on reload; an inline script in each page head sets html.seen
   when moving between pages, so clicking through the site never replays it. Reduced motion keeps the fade and drops the movement. */
@keyframes fade-in { from { opacity: 0; } }
@keyframes drop-in { from { opacity: 0; translate: 0 -28px; } }
html:not(.seen) .site-header > :first-child,
html:not(.seen) .site-header nav a,
html:not(.seen) .header-contact { animation: fade-in .4s ease both; }
html:not(.seen) .site-header nav a:nth-child(1) { animation-delay: .06s; }
html:not(.seen) .site-header nav a:nth-child(2) { animation-delay: .12s; }
html:not(.seen) .site-header nav a:nth-child(3) { animation-delay: .18s; }
html:not(.seen) .header-contact { animation-delay: .24s; }
@media (prefers-reduced-motion: no-preference) {
  html:not(.seen) .site-header > :first-child { animation-duration: .5s; animation-timing-function: var(--ease); }
  html:not(.seen) .site-header nav a,
  html:not(.seen) .header-contact { animation-name: drop-in; animation-duration: .5s; animation-timing-function: var(--ease); }
}

/* The one button style: accent pill, used for every button and contact action */
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 20px; border-radius: 99px;
  background: var(--accent); color: var(--ink); font-weight: 700; font-size: 15px;
  transition: transform .25s var(--ease), background-color .25s var(--ease);
}
button.pill { border: 0; font-family: inherit; cursor: pointer; }
.pill:hover { transform: translateY(-1px); }
.pill .arrow { transition: transform .25s var(--ease); }
.pill:hover .arrow { transform: translateX(3px); }

@media (max-width: 720px) {
  .site-header { grid-template-columns: 1fr auto; }
  .site-header nav { display: none; }
}

/* Shared with every page */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
/* Underlined text link (hero, project cards, resume, all notes) */
.line-link {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--ink); font-weight: 500;
  text-decoration: underline 1px; text-underline-offset: 8px;
  transition: text-underline-offset .25s var(--ease);
}
.line-link:hover { text-underline-offset: 4px; }
/* Dark pill: the lead case study call to action */
.pill--dark { background: var(--ink); color: var(--paper); }
.pill--dark:hover { background: #000; }

/* Contact and footer: one dark closing band, the same on every page */
.contact { background: var(--night); color: var(--night-grey); padding-top: clamp(80px, 10vw, 144px); }
.contact h2 {
  font-size: clamp(48px, 10.4vw, 156px); line-height: .95; letter-spacing: -.01em; font-weight: 500;
  color: var(--night-ink); text-wrap: balance;
}
.contact-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px;
  margin-top: clamp(40px, 5vw, 72px);
}
.contact-row p { max-width: 28ch; font-size: var(--fs-h4); line-height: 1.45; color: var(--night-ink); }
.contact .pill { min-height: 56px; padding: 0 28px; font-size: 16px; }

.band-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px;
  margin-top: clamp(64px, 8vw, 112px); padding-block: 28px 40px;
  font-size: 14px; border-top: 1px solid #3a3936;
}
.footer-logo img { width: 80px; height: auto; filter: invert(1); }
.band-footer nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
.band-footer nav a, .band-footer .copy-email { transition: color .2s var(--ease); }
.band-footer nav a:hover, .band-footer .copy-email:hover { color: var(--night-ink); }
/* Copy my email: a footer link like the others (a button, it copies instead of navigating) */
.band-footer .copy-email { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }

/* Notes rows: home Notes section and the notes index. Hairline rows, no arrows: the title carries the link.
   The home stacks title and description; the notes index splits them (note.css). */
.note-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.note-rows li { border-bottom: 1px solid var(--rule); }
.note-row { display: grid; gap: 12px 24px; align-items: baseline; padding-block: clamp(28px, 3.4vw, 44px); }
.note-row-title {
  font-size: var(--fs-h3); line-height: 1.1; letter-spacing: -.008em; font-weight: 500;
  text-wrap: balance; text-decoration: underline 1px transparent; text-underline-offset: 6px;
  transition: text-decoration-color .25s var(--ease);
}
.note-row-desc { max-width: 40ch; }
.note-row:hover .note-row-title { text-decoration-color: currentColor; }

/* Reveal on scroll, CSS only where supported */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
    @keyframes rise {
      from { opacity: 0; transform: translateY(48px); }
      to { opacity: 1; transform: none; }
    }
  }
}

/* Contact modal (scripts/site.js) */
.contact-modal {
  width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px);
  padding: clamp(24px, 4vw, 40px); border: 0; border-radius: var(--radius);
  background: var(--card); color: var(--body);
}
.contact-modal::backdrop { background: rgb(31 30 28 / .45); }
.contact-modal[open] { animation: cm-in .35s var(--ease); }
@keyframes cm-in { from { opacity: 0; transform: translateY(12px); } }
.cm-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.cm-head h2 { font-size: var(--fs-h3); line-height: 1.1; letter-spacing: -.01em; font-weight: 500; }
.cm-close {
  width: 40px; height: 40px; flex: none; margin: -8px -8px 0 0; padding: 0; border: 0;
  background: none; color: var(--grey); font: inherit; font-size: 28px; line-height: 1; cursor: pointer;
  transition: color .2s var(--ease);
}
.cm-close:hover { color: var(--ink); }
.cm-lede { margin: 10px 0 24px; }
.cm-field { display: grid; gap: 6px; margin-bottom: 16px; font-size: 14px; color: var(--grey); }
.cm-field input, .cm-field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); font: inherit; font-size: 16px; resize: vertical;
}
.cm-field input:focus-visible, .cm-field textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.cm-status { min-height: 1.4em; margin: 0 0 12px; font-size: 14px; color: var(--ink); }

@media (prefers-reduced-motion: reduce) { .contact-modal[open] { animation: none; } }
