/* ==========================================================================
   yasinskiy.se — stylesheet
   Self-hosted fonts, light/dark tokens, fluid type, minimal motion.
   ========================================================================== */

/* ---- Fonts (self-hosted woff2 subsets, SIL OFL) ---- */
@font-face {
  font-family: "Inter Tight";
  src: url("/fonts/inter-tight-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Tight";
  src: url("/fonts/inter-tight-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
/* ---- Tokens ---- */
:root {
  --bg: #F6F4EF;
  --ink: #111111;
  --muted: #6B6B66;
  --rule: #DAD7CF;
  --accent: #C8481F; /* darkened from brief's #E4572E for AA on light bg */
  --surface: #FFFFFF;

  --font-display: "Inter Tight", -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter Tight", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Inter Tight", -apple-system, "Segoe UI", sans-serif;

  --max-w: 1120px;
  --gutter: 24px;

  --section-pad: clamp(64px, 10vw, 160px);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0E0D;
    --ink: #EDEBE6;
    --muted: #9A9892;
    --rule: #2A2A27;
    --accent: #F07A52;
    --surface: #171715;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0E0D;
  --ink: #EDEBE6;
  --muted: #9A9892;
  --rule: #2A2A27;
  --accent: #F07A52;
  --surface: #171715;
  color-scheme: dark;
}

/* ---- Reset & base ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(17px, 0.95vw + 14px, 19px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.1; margin: 0; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }

.wrap {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 0; top: -100%;
  background: var(--ink); color: var(--bg);
  padding: 12px 20px; z-index: 100;
  font-family: var(--font-mono); font-size: 14px;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 16px;
}
.brand {
  font-family: var(--font-mono); font-size: 14px; text-decoration: none;
  letter-spacing: 0.01em;
}
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--rule); color: var(--ink);
  font-family: var(--font-mono); font-size: 13px;
  padding: 6px 12px; cursor: pointer;
}
.nav-list {
  display: flex; align-items: center; gap: clamp(16px, 2.5vw, 32px);
  font-family: var(--font-mono); font-size: 13px;
}
.nav-list a { text-decoration: none; }
.nav-list a:not(.nav-cta) { position: relative; }
.nav-list a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform 0.15s ease;
}
.nav-list a:not(.nav-cta):hover::after,
.nav-list a:not(.nav-cta):focus-visible::after { transform: scaleX(1); }
.nav-cta {
  border: 1px solid var(--ink); padding: 6px 14px;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-cta:hover, .nav-cta:focus-visible { background: var(--ink); color: var(--bg); }

@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .nav-list {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: flex-start; gap: 18px;
    background: var(--bg); border-bottom: 1px solid var(--rule);
    padding: 20px var(--gutter) 28px;
  }
  .nav-list.is-open { display: flex; }
}

/* ---- Hero ---- */
.hero {
  padding-top: clamp(72px, 14vw, 160px);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(200px, 25vw, 300px);
  gap: clamp(24px, 5vw, 64px); align-items: end;
}
.hero-copy { padding-bottom: var(--section-pad); }
.hero-portrait { width: 100%; height: auto; }
@media (max-width: 720px) {
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .hero-portrait { width: 200px; justify-self: end; margin-top: -8px; }
  .hero-copy { padding-bottom: 32px; }
}
.eyebrow {
  font-family: var(--font-mono); font-size: 13px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin-bottom: 20px;
}
.hero-h1 {
  font-size: clamp(2.4rem, 4.4vw + 1rem, 5rem);
  max-width: 16ch;
  margin-bottom: 28px;
}
.hero-sub {
  font-size: clamp(1.05rem, 0.6vw + 0.95rem, 1.35rem);
  color: var(--muted);
  max-width: 56ch;
  margin-bottom: 36px;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 16px; }

.btn {
  display: inline-block;
  font-family: var(--font-body); font-weight: 500; font-size: 1rem;
  text-decoration: none; padding: 14px 26px; border: 1px solid var(--ink);
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover, .btn-primary:focus-visible { transform: translateY(-1px); }

/* ---- Sections ---- */
.section { padding-block: var(--section-pad); border-bottom: 1px solid var(--rule); }
.section-h {
  font-size: clamp(1.9rem, 2.4vw + 1rem, 3rem);
  margin-bottom: clamp(36px, 5vw, 64px);
  max-width: 20ch;
}
.sub-h {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.3rem, 1vw + 1rem, 1.7rem);
  margin-bottom: 16px;
}

/* ---- Shared labels ---- */
.fit-label {
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px;
}
.mono {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  color: var(--muted); letter-spacing: 0.04em;
}
.hero-h1 em, .section-h em { color: var(--accent); }

/* ---- Now running: experiment log ---- */
.exp {
  display: grid; grid-template-columns: 11rem 1fr; gap: 24px;
  padding-block: 28px; border-top: 1px solid var(--rule);
}
.exp:last-child { border-bottom: 1px solid var(--rule); }
.exp-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.exp h3 { font-size: clamp(1.2rem, 0.6vw + 1rem, 1.45rem); margin-bottom: 14px; }
.exp dl { margin: 0; display: grid; grid-template-columns: 7rem 1fr; gap: 8px 16px; }
.exp dt { padding-top: 4px; }
.exp dd { margin: 0; max-width: 60ch; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status[data-status="running"] { color: var(--accent); }
.status[data-status="learned"] { color: var(--ink); }
@media (max-width: 720px) {
  .exp { grid-template-columns: 1fr; gap: 12px; }
  .exp-meta { flex-direction: row; gap: 16px; }
  .exp dl { grid-template-columns: 1fr; gap: 2px; }
  .exp dd { margin-bottom: 10px; }
}

/* ---- Built with P2000 OS ---- */
.build-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.build { border: 1px solid var(--rule); background: var(--surface); }
.build-shot {
  aspect-ratio: 16 / 10; border-bottom: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center;
}
.build h3 { font-size: 1.3rem; margin: 22px 22px 10px; }
.build p { margin: 0 22px 14px; color: var(--muted); }
.build .build-facts { margin-bottom: 22px; }
@media (max-width: 720px) { .build-grid { grid-template-columns: 1fr; } }

/* ---- Built outside it: metric grid ---- */
.metric-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
}
.metric { padding: 32px 24px 32px 0; border-bottom: 1px solid var(--rule); }
.metric-n {
  font-family: var(--font-display); font-weight: 500; line-height: 1;
  font-size: clamp(2.4rem, 3vw + 1rem, 3.6rem); color: var(--accent); margin-bottom: 14px;
}
.metric h3 { font-size: 1.15rem; margin-bottom: 8px; }
.metric p:not(.metric-n) { color: var(--muted); font-size: 0.95rem; max-width: 36ch; }
@media (max-width: 860px) { .metric-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .metric-grid { grid-template-columns: 1fr; } }

/* ---- About: narrative + facts sidebar ---- */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
.about-copy p { max-width: 58ch; font-size: 1.05rem; }
.about-side {
  border-left: 1px solid var(--rule); padding-left: 32px;
  display: flex; flex-direction: column; gap: 32px;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list li { font-size: 0.85rem; padding: 5px 11px; border: 1px solid var(--rule); }
.row-list li {
  display: flex; justify-content: space-between; gap: 16px;
  padding-block: 9px; border-bottom: 1px solid var(--rule); font-size: 0.95rem;
}
.row-list li span:last-child { color: var(--muted); font-size: 0.88rem; white-space: nowrap; }
.side-link { margin: 12px 0 0; font-size: 0.9rem; }
.side-link a { text-underline-offset: 4px; }
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 32px; }
}

/* ---- Contact ---- */
.section-contact { border-bottom: none; }
.contact-sub { color: var(--muted); font-size: clamp(1.05rem, 0.6vw + 0.95rem, 1.3rem); margin-bottom: 28px; }
.contact-alt { margin-top: 20px; color: var(--muted); font-size: 0.92rem; }
.contact-alt a { text-underline-offset: 4px; }

/* ---- Footer ---- */
.site-footer { padding-block: 48px; }
.footer-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  font-size: 0.85rem; color: var(--muted);
}
.footer-col p { margin: 0 0 6px; }
.footer-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.theme-toggle {
  font-family: var(--font-mono); font-size: 12px; background: none;
  border: 1px solid var(--rule); color: var(--ink); padding: 8px 14px; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ink); }
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-controls { align-items: flex-start; }
}

/* ---- Motion: reveal-once, respects reduced motion ---- */
.reveal-lines, .reveal-fade { opacity: 0; transform: translateY(10px); }
.reveal-lines.is-visible, .reveal-fade.is-visible {
  opacity: 1; transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
@media (prefers-reduced-motion: reduce) {
  .reveal-lines, .reveal-fade { opacity: 1 !important; transform: none !important; }
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

/* ---- AI in PMM page ---- */
.lede { font-size: clamp(1.05rem, 0.6vw + 0.95rem, 1.25rem); max-width: 62ch; color: var(--muted); margin-bottom: 40px; }
.nav-list a[aria-current="page"]::after { transform: scaleX(1); }
.shot { margin: 0; }
.shot img {
  width: 100%; height: auto;
  border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--ink) 10%, transparent);
}
.shot figcaption { margin-top: 12px; font-size: 12px; color: var(--muted); }
.shot-main { margin-bottom: 48px; }
.shot-inline { margin-top: 24px; }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.feature { border: 1px solid var(--rule); background: var(--surface); padding: 28px; }
.feature-wide { grid-column: 1 / -1; }
.feature .pill { margin-bottom: 16px; display: inline-block; }
.feature h3 { font-size: 1.3rem; margin-bottom: 12px; }
.feature p { color: var(--muted); max-width: 70ch; }
.feature .why { color: var(--ink); font-size: 0.95rem; margin: 0; }
.feature p:last-of-type { margin-bottom: 0; }
.closing-line { font-family: var(--font-display); font-size: clamp(1.3rem, 1.2vw + 1rem, 1.8rem); line-height: 1.3; max-width: 36em; margin: 48px 0 0; }
.principles { border-top: 1px solid var(--rule); max-width: 62ch; }
.principles li { padding-block: 16px; border-bottom: 1px solid var(--rule); }
@media (max-width: 720px) { .feature-grid { grid-template-columns: 1fr; } }

/* ---- Nav CTA as button ---- */
button.nav-cta { font: inherit; background: transparent; color: var(--ink); cursor: pointer; }
button.nav-cta:hover, button.nav-cta:focus-visible { background: var(--ink); color: var(--bg); }
button.btn { cursor: pointer; }

/* ---- Booking dialog: sized to the viewport so the page never scrolls.
   Width is fixed at the iframe's two-column breakpoint (calendar + time picker side by side);
   below that it goes full-bleed so the embed switches to its stacked layout in one step. ---- */
.book-dialog {
  position: fixed; inset: 0; margin: auto;
  width: min(880px, calc(100vw - 32px)); height: min(720px, calc(100dvh - 32px));
  padding: 0; border: 1px solid var(--rule); background: #fff; color: #111; overflow: hidden;
}
.book-dialog[open] { display: block; }
.book-dialog::backdrop { background: rgba(0,0,0,0.55); }
.book-frame { display: block; border: 0; width: 100%; height: 100%; background: #fff; }
.book-close {
  position: absolute; top: 8px; right: 8px; z-index: 1; width: 36px; height: 36px;
  font-size: 26px; line-height: 1; background: rgba(255,255,255,0.9); border: 0; border-radius: 50%;
  color: #111; cursor: pointer;
}
.book-close:hover { background: #eee; }
@media (max-width: 640px) {
  .book-dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; }
}

/* ---- Problems ---- */
.problem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.problem {
  display: flex; flex-direction: column; align-items: flex-start; gap: 20px;
  padding: 24px; background: var(--surface); border: 1px solid var(--rule); border-radius: 12px;
}
.problem p { margin: 0; }
.problem-q { font-family: var(--font-display); font-size: clamp(1.15rem, 0.6vw + 1rem, 1.4rem); line-height: 1.25; }
.pill {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  padding: 4px 10px; border-radius: 999px;
}
@media (max-width: 860px) { .problem-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .problem-grid { grid-template-columns: 1fr; } }
