/* Arko Logic — site styles */

@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #f4f3ef;
  --bg-raised: #ecebe5;
  --ink: #0b0b0b;
  --ink-2: #3b3a37;
  --muted: #7a7770;
  --line: rgba(11, 11, 11, 0.12);
  --line-strong: rgba(11, 11, 11, 0.24);

  /* product surfaces stay dark in both themes */
  --stage: #0e0f0e;
  --stage-ink: #f2f0ea;
  --stage-muted: #9a978f;
  --scenarly: #3fcf7f;

  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 10px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --header-h: 68px;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0a;
    --bg-raised: #141412;
    --ink: #f2f0ea;
    --ink-2: #cfccc4;
    --muted: #8d8a83;
    --line: rgba(242, 240, 234, 0.1);
    --line-strong: rgba(242, 240, 234, 0.22);
    --stage: #121311;
  }
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

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

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  padding: 10px 14px; background: var(--ink); color: var(--bg); border-radius: 6px;
}
.skip:focus { top: 12px; }

.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;
}

/* ---------- type ---------- */

.label {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--muted);
}
.label .n { color: var(--ink); }

.display {
  font-size: clamp(2.6rem, 7.4vw, 6.4rem);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.h2 {
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
em, .serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
}
.display em, .h2 em { padding-right: 0.04em; }
/* tight tracking also shrinks the spaces; give words room, especially before the italic accent */
.display, .h2 { word-spacing: 0.12em; }
.lede { font-size: clamp(1.125rem, 1.6vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: 34em; text-wrap: pretty; }
.muted { color: var(--muted); }
p { text-wrap: pretty; }

/* ---------- buttons & links ---------- */

.btn {
  --h: 48px;
  display: inline-flex; align-items: center; gap: 10px;
  height: var(--h); padding: 0 20px;
  border-radius: var(--radius);
  background: var(--ink); color: var(--bg);
  font-weight: 550; font-size: 0.975rem; letter-spacing: -0.01em;
  transition: transform 0.4s var(--ease), background-color 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn .arrow { transition: transform 0.4s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }

.arrow { width: 14px; height: 14px; flex: none; }

/* underline that grows like one of the logo bars */
.link {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 550;
}
.link::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -3px; height: 2px;
  background: currentColor; border-radius: 2px;
  transform: scaleX(0.25); transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.link:hover::after, .link:focus-visible::after { transform: scaleX(1); }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: flex; align-items: center; color: var(--ink); }
.brand svg { height: 26px; width: auto; aspect-ratio: 2307 / 1077; transition: transform 0.5s var(--ease); }
.brand:hover svg { transform: scale(1.04); }

.nav { display: flex; align-items: center; gap: clamp(4px, 1.5vw, 12px); }
.nav > a, .dd > summary {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 clamp(8px, 1.2vw, 12px);
  border-radius: 8px;
  font-size: 0.95rem; font-weight: 500; letter-spacing: -0.01em;
  color: var(--ink-2);
  transition: color 0.2s, background-color 0.2s;
}
.nav > a:hover, .dd > summary:hover, .dd[open] > summary { color: var(--ink); background: var(--bg-raised); }
.nav > a[aria-current="page"], .dd.is-current > summary { color: var(--ink); }
.nav > a[aria-current="page"]::after, .dd.is-current > summary::after {
  content: ""; position: absolute; left: 50%; bottom: 4px;
  width: 4px; height: 4px; border-radius: 50%; background: currentColor; transform: translateX(-50%);
}

/* products dropdown */
.dd { position: relative; }
.dd > summary { list-style: none; cursor: pointer; user-select: none; }
.dd > summary::-webkit-details-marker { display: none; }
.dd .chev { width: 10px; height: 10px; transition: transform 0.35s var(--ease); }
.dd[open] .chev { transform: rotate(180deg); }

.dd-menu {
  position: absolute; top: calc(100% + 10px); left: 50%;
  width: min(340px, calc(100vw - 2 * var(--gutter)));
  translate: -50% 0;
  padding: 8px;
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line), 0 24px 48px -16px rgba(0, 0, 0, 0.22), 0 4px 12px -4px rgba(0, 0, 0, 0.08);
  animation: dd-in 0.35s var(--ease);
}
/* hover bridge so the menu doesn't close crossing the gap */
.dd-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }

.dd-head { padding: 8px 10px 6px; }
.dd-item {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px;
  padding: 10px; border-radius: 10px;
  transition: background-color 0.2s;
}
a.dd-item:hover, a.dd-item:focus-visible { background: var(--bg-raised); }
.dd-item .tile {
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--stage); color: var(--stage-ink);
}
.dd-item strong { display: block; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.dd-item small { display: block; font-size: 0.85rem; color: var(--muted); line-height: 1.35; }
.dd-item .arrow { color: var(--muted); transition: transform 0.4s var(--ease), color 0.2s; }
a.dd-item:hover .arrow { transform: translateX(3px); color: var(--ink); }

@media (max-width: 560px) {
  .dd-menu { position: fixed; top: calc(var(--header-h) - 4px); left: var(--gutter); right: var(--gutter); width: auto; translate: none; }
}

/* ---------- reveal ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* above-the-fold content: plain CSS entrance, no JS or scroll position involved */
.enter > * { animation: enter 0.9s var(--ease) both; }
.enter > :nth-child(2) { animation-delay: 0.07s; }
.enter > :nth-child(3) { animation-delay: 0.14s; }
.enter > :nth-child(4) { animation-delay: 0.21s; }
.enter > :nth-child(5) { animation-delay: 0.28s; }
.enter > :nth-child(n + 6) { animation-delay: 0.35s; }
@keyframes enter { from { opacity: 0; transform: translateY(18px); } }

/* ---------- sections ---------- */

.section { padding-block: clamp(72px, 12vw, 152px); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding-top: 18px; margin-bottom: clamp(32px, 5vw, 56px);
  border-top: 1px solid var(--line);
}

/* ---------- home hero ---------- */

/* Fills the first screen exactly, so nothing from the next section peeks in above the fold.
   Extra bottom padding sits the text slightly above centre. */
.hero {
  display: grid; align-content: center;
  min-height: calc(100svh - var(--header-h));
  padding-block: clamp(40px, 6vh, 72px) clamp(64px, 14vh, 160px);
  position: relative; isolation: isolate; overflow: hidden;
  --wave-s: 1;
}

/* Two ribbon bundles drifting left to right behind the hero copy. Each tile holds exactly one
   wave period, so sliding a layer by one tile width loops seamlessly at any viewport size.
   The SVGs are masks over --ink, so the lines follow the colour scheme. */
.hero::before, .hero::after {
  content: ""; position: absolute; z-index: -1;
  top: 18%; bottom: 0; left: 0;
  width: calc(100% + var(--tile));
  background: var(--ink);
  -webkit-mask: var(--src) left center / var(--tile) calc(600px * var(--wave-s)) repeat-x;
  mask: var(--src) left center / var(--tile) calc(600px * var(--wave-s)) repeat-x;
  animation: hero-wave var(--dur) linear infinite;
  will-change: transform;
  pointer-events: none;
}
.hero::before {
  --src: url("/assets/img/hero-wave-back.svg");
  --tile: calc(1440px * var(--wave-s));
  --dur: 72s;
  opacity: 0.16;
}
.hero::after {
  --src: url("/assets/img/hero-wave-front.svg");
  --tile: calc(720px * var(--wave-s));
  --dur: 30s;
  opacity: 0.1;
}
@keyframes hero-wave {
  from { transform: translateX(calc(-1 * var(--tile))); }
  to { transform: none; }
}
@media (max-width: 600px) { .hero { --wave-s: 0.6; } }
@media (prefers-color-scheme: dark) {
  .hero::before { opacity: 0.2; }
  .hero::after { opacity: 0.13; }
}
@media (prefers-reduced-motion: reduce) {
  .hero::before, .hero::after { animation: none; }
}
.hero-row { margin-top: clamp(28px, 4vw, 44px); }
.hero-side { display: grid; gap: 32px; justify-items: start; }

/* ---------- product feature (scenarly) ---------- */

.feature {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  min-height: 520px;
  border-radius: 20px;
  background: var(--stage); color: var(--stage-ink);
  box-shadow: inset 0 0 0 1px rgba(242, 240, 234, 0.07);
}
.feature::before {
  content: ""; position: absolute; inset: auto -10% -40% 30%; height: 90%; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--scenarly) 22%, transparent), transparent);
  filter: blur(30px);
  transition: transform 1.2s var(--ease);
}
.feature:hover::before { transform: translate(-4%, -6%); }
.feature-body { display: flex; flex-direction: column; gap: 22px; padding: clamp(28px, 4.5vw, 56px); }
.feature-body .label { color: var(--stage-muted); }
.feature-body p { color: var(--stage-muted); max-width: 30em; }
.feature-body .grow { flex: 1; }
.feature-link { color: var(--stage-ink); }
.feature-shot { position: relative; align-self: end; margin-right: -14%; margin-bottom: -2%; }
.feature-shot img { width: 100%; height: auto; transition: transform 1.2s var(--ease); }
.feature:hover .feature-shot img { transform: translate(-1.5%, -2%) scale(1.015); }

.s-logo {
  display: block;
  width: min(260px, 70%); aspect-ratio: 1200 / 296;
  background: currentColor;
  -webkit-mask: url("/assets/img/scenarly-logo.png") left center / contain no-repeat;
  mask: url("/assets/img/scenarly-logo.png") left center / contain no-repeat;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 0.85rem; font-weight: 500; line-height: 1.2;
  padding: 6px 12px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(242, 240, 234, 0.16); color: var(--stage-ink);
}
.chip i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--scenarly); margin-right: 8px; vertical-align: 1px; }

@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; min-height: 0; }
  .feature-shot { margin: 0 -18% -4% 6%; }
}

.work-head {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px clamp(28px, 5vw, 80px); align-items: end;
  margin-bottom: clamp(32px, 5vw, 56px);
}
@media (max-width: 820px) { .work-head { grid-template-columns: 1fr; } }

/* ---------- principles ---------- */

.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 4vw, 48px); counter-reset: p; }
.principle { display: grid; gap: 14px; align-content: start; }
.principle::before {
  content: ""; height: 10px; width: 100%; border-radius: 3px; background: var(--ink);
  transform-origin: left; transform: scaleX(0.18);
  transition: transform 1.2s var(--ease) var(--d, 0s);
}
html:not(.js) .principle::before, .principle.is-in::before { transform: scaleX(1); }
.principle::before { margin-bottom: 10px; }
.principle p { color: var(--ink-2); }
@media (max-width: 820px) { .principles { grid-template-columns: 1fr; } }

/* ---------- CTA ---------- */

.cta { display: grid; gap: 28px; justify-items: start; }
.cta-link {
  display: inline-flex; align-items: center; gap: 0.3em;
  font-size: clamp(2.4rem, 8vw, 7rem); font-weight: 600; letter-spacing: -0.05em; line-height: 1;
}
.cta-link .arrow { width: 0.6em; height: 0.6em; transition: transform 0.6s var(--ease); }
.cta-link:hover .arrow { transform: translate(0.12em, -0.12em); }

.crumbs { display: flex; gap: 8px; align-items: center; }
.crumbs a:hover { color: var(--ink); }

/* ---------- single-screen pages (about, contact, 404) ---------- */

/* Fits the viewport exactly; on very short screens (landscape phones) it falls back to scrolling
   rather than cutting content off */
@media (min-height: 520px) {
  body.fit { height: 100svh; min-height: 0; overflow: hidden; }
}
body.fit main { display: grid; align-content: center; }
.placeholder { display: grid; gap: clamp(18px, 3vh, 32px); justify-items: start; padding-block: clamp(24px, 5vh, 64px); }
.placeholder .display { max-width: 12em; }
.placeholder .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(4px, 1vh, 12px); }
.placeholder--center { justify-items: center; text-align: center; }
.placeholder--center .display { margin-inline: auto; }

/* ---------- rows ---------- */

.rows { border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 24px; align-items: center;
  padding: 26px 0; border-bottom: 1px solid var(--line);
  transition: padding 0.5s var(--ease);
}
a.row:hover { padding-inline: 12px; }
.row .arrow { color: var(--muted); }
a.row:hover .arrow { color: var(--ink); }
@media (max-width: 720px) {
  .row { grid-template-columns: 1fr auto; gap: 6px 16px; }
  .row > p { grid-column: 1; }
  .row > .arrow { grid-row: 1 / span 2; grid-column: 2; }
}

/* ---------- contact ---------- */

.mail {
  font-size: clamp(1.4rem, 4.2vw, 2.6rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.15;
  overflow-wrap: anywhere;
}
.copy[data-copied] .copy-idle, .copy:not([data-copied]) .copy-done { display: none; }

/* ---------- product page ---------- */

.p-hero { padding-block: clamp(48px, 8vw, 104px) 0; }
.p-hero .s-logo { width: min(560px, 100%); margin-block: 32px 36px; color: var(--ink); }
.p-hero .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.stage {
  position: relative; isolation: isolate; overflow: hidden;
  margin-top: clamp(48px, 8vw, 96px);
  border-radius: 24px; background: var(--stage);
  padding: clamp(24px, 5vw, 64px) 0 0 clamp(24px, 5vw, 64px);
}
.stage::before {
  content: ""; position: absolute; inset: 20% 10% -30% 20%; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--scenarly) 18%, transparent), transparent);
  filter: blur(40px);
}
.stage img { width: 112%; max-width: none; height: auto; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.features > div { padding: 30px 28px 34px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; align-content: start; }
.features > div + div { padding-left: 28px; }
.features > div:nth-child(3n + 1) { padding-left: 0; }
.features > div:not(:nth-child(3n)) { border-right: 1px solid var(--line); }
.features p { color: var(--ink-2); font-size: 0.975rem; }
@media (max-width: 820px) {
  .features { grid-template-columns: 1fr; }
  .features > div, .features > div + div { padding: 26px 0; border-right: 0 !important; }
}

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fact { padding: 26px; border-radius: 16px; background: var(--bg-raised); display: grid; gap: 6px; }
.fact b { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; }
.fact span { color: var(--ink-2); font-size: 0.975rem; }
@media (max-width: 820px) { .facts { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */

.site-footer { padding-block: clamp(56px, 8vw, 96px) 28px; border-top: 1px solid var(--line); margin-top: clamp(40px, 6vw, 80px); }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.foot-brand svg { width: min(220px, 60vw); height: auto; aspect-ratio: 2311 / 1155; color: var(--ink); }
.foot-brand p { margin-top: 20px; color: var(--muted); max-width: 22em; font-size: 0.95rem; }
.foot-col { display: grid; gap: 10px; align-content: start; font-size: 0.95rem; }
.foot-col .label { margin-bottom: 6px; }
.foot-col a { color: var(--ink-2); justify-self: start; }
.foot-col a:hover { color: var(--ink); }
.foot-base {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: clamp(48px, 7vw, 80px); padding-top: 20px; border-top: 1px solid var(--line);
}
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }

.site-footer--compact { margin-top: 0; padding-block: 18px; }
.site-footer--compact .foot-base { margin-top: 0; padding-top: 0; border-top: 0; }
@media (max-width: 480px) { .site-footer--compact .foot-base > :last-child { display: none; } }

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}

/* ---------- spacing helpers ---------- */

.h2 + .principles, .h2.spaced + * { margin-top: clamp(40px, 6vw, 80px); }
.cta--after { margin-top: clamp(56px, 9vw, 112px); }
.tile .serif { font-size: 28px; line-height: 1; transform: translateY(1px); }

.p-hero .lede { margin-top: 28px; }
.section-head .label { white-space: nowrap; }

/* ---------- small screens ---------- */

body { -webkit-tap-highlight-color: transparent; }

@media (max-width: 600px) {
  :root { --header-h: 60px; }
  .section { padding-block: 64px; }
  .feature { border-radius: 16px; }
  .feature-body { gap: 18px; }
  .stage { border-radius: 16px; }
  .btn { --h: 46px; padding: 0 18px; }
  .p-hero .actions .btn, .placeholder .actions .btn { flex: 1 1 auto; justify-content: center; }
  .facts .fact { padding: 22px; }
}
@media (max-width: 380px) {
  .brand svg { height: 22px; }
  .nav { gap: 0; }
  .nav > a, .dd > summary { padding: 0 8px; font-size: 0.9rem; }
}
