/* ==========================================================
   Archnet — portfolio
   ========================================================== */

:root {
  --paper: #f3f1ec;
  --paper-2: #e9e6df;
  --card: #fbfaf7;
  --ink: #14161a;
  --ink-2: #3b3f47;
  --muted: #6b6f78;
  --line: #d6d2c9;
  --grid: rgba(20, 22, 26, .06);
  --accent: #ff5b1f;
  --accent-ink: #ffffff;
  --accent-soft: rgba(255, 91, 31, .12);
  --shadow: 0 1px 2px rgba(20, 22, 26, .06), 0 12px 32px -12px rgba(20, 22, 26, .18);

  --f-display: "Space Grotesk", system-ui, sans-serif;
  --f-body: "Inter", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --r: 14px;
  --wrap: 1180px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1013;
    --paper-2: #14171b;
    --card: #171a1f;
    --ink: #eceae4;
    --ink-2: #c3c1bb;
    --muted: #8d9099;
    --line: #2a2e35;
    --grid: rgba(236, 234, 228, .05);
    --accent: #ff6a33;
    --accent-soft: rgba(255, 106, 51, .14);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1013;
  --paper-2: #14171b;
  --card: #171a1f;
  --ink: #eceae4;
  --ink-2: #c3c1bb;
  --muted: #8d9099;
  --line: #2a2e35;
  --grid: rgba(236, 234, 228, .05);
  --accent: #ff6a33;
  --accent-soft: rgba(255, 106, 51, .14);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -16px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.08; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
@media (max-width: 600px) { .wrap { padding-inline: 16px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- buttons & bits ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  background: var(--accent); color: var(--accent-ink);
  font: 600 15px/1 var(--f-body);
  padding: 15px 22px; border-radius: 999px; border: 0;
  text-decoration: none; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: 0 8px 20px -8px var(--accent);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -10px var(--accent); }
.btn span { transition: transform .2s ease; }
.btn:hover span { transform: translateX(3px); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn--small { padding: 10px 16px; font-size: 14px; box-shadow: none; }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { border-color: var(--ink); }

.eyebrow, .kicker, .project__type, .service__num {
  font: 500 13px/1.3 var(--f-mono);
  letter-spacing: .04em;
  color: var(--muted);
}
.kicker { color: var(--accent); text-transform: uppercase; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; margin-right: 6px; box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); vertical-align: 1px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  font: 500 12.5px/1 var(--f-mono);
  padding: 7px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-2); background: var(--card);
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}
.nav.is-scrolled { border-color: var(--line); }
.nav__inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 21px/1 var(--f-display); letter-spacing: -.03em; }
.brand__mark { width: 28px; height: 28px; color: var(--ink); }
.brand--small { font-size: 17px; }
.brand--small .brand__mark { width: 22px; height: 22px; }
.nav nav { margin-left: auto; }
.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__links a:not(.btn) { text-decoration: none; font-weight: 500; font-size: 15px; color: var(--ink-2); }
.nav__links a:not(.btn):hover { color: var(--ink); }
.nav__tools { display: flex; gap: 8px; }
.nav__burger { display: none; }

.icon-btn .moon { display: none; }
:root[data-theme="dark"] .icon-btn .sun { display: none; }
:root[data-theme="dark"] .icon-btn .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .sun { display: none; }
  :root:not([data-theme="light"]) .icon-btn .moon { display: block; }
}

@media (max-width: 820px) {
  .nav__burger { display: grid; }
  .nav nav { margin-left: auto; }
  .nav__links {
    position: absolute; left: 0; right: 0; top: 68px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px 16px 16px;
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links li a:not(.btn) { display: block; padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 17px; }
  .nav__links .btn { margin-top: 14px; justify-content: center; width: 100%; padding: 14px; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 72px 0 96px;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  border-bottom: 1px solid var(--line);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 20% 40%, transparent 30%, var(--paper) 100%);
}
.hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(52px, 8.4vw, 112px); font-weight: 700; margin: 20px 0 24px; letter-spacing: -.045em; line-height: .95; }
.hero h1 em { font-style: normal; color: var(--accent); position: relative; }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); max-width: 36ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__facts { display: flex; gap: 40px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); max-width: 480px; }
.hero__facts li { display: flex; flex-direction: column; gap: 2px; }
.hero__facts strong { font: 700 28px/1 var(--f-display); letter-spacing: -.02em; }
.hero__facts span { font: 400 13px/1.3 var(--f-mono); color: var(--muted); }

.hero__diagram { margin: 0; aspect-ratio: 1; width: 100%; max-width: 480px; justify-self: end;
  background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 12px; }
.hero__diagram svg { width: 100%; height: 100%; display: block; }
.hero__diagram .grid-lines path { stroke: var(--grid); stroke-width: 1; }
.hero__diagram .links path { stroke: var(--line); stroke-width: 2; fill: none; stroke-dasharray: 5 5; animation: dash 12s linear infinite; }
.hero__diagram .pulses circle { fill: var(--accent); }
.hero__diagram .node rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.hero__diagram .node text { font: 500 12px var(--f-mono); fill: var(--ink); text-anchor: middle; }
.hero__diagram .node--strong rect { fill: var(--ink); }
.hero__diagram .node--strong text { fill: var(--paper); font-size: 13px; }
.hero__diagram .node--accent rect { fill: var(--accent-soft); stroke: var(--accent); }
.hero__diagram .tags text { font: 500 10px var(--f-mono); fill: var(--muted); letter-spacing: .06em; }
@keyframes dash { to { stroke-dashoffset: -200; } }

@media (max-width: 900px) {
  .hero { padding: 48px 0 64px; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__diagram { justify-self: center; max-width: 380px; }
}
@media (max-width: 480px) {
  .hero__facts { gap: 20px; }
  .hero__facts strong { font-size: 22px; }
  .hero__cta .btn { width: 100%; justify-content: center; }
}

/* ---------- sections ---------- */
.section { padding: 112px 0; }
.section--alt { background: var(--paper-2); border-block: 1px solid var(--line); }
.section__head { max-width: 720px; margin-bottom: 56px; }
.section__head h2 { font-size: clamp(34px, 4.6vw, 56px); font-weight: 700; margin: 14px 0 18px; letter-spacing: -.035em; }
.section__intro { color: var(--ink-2); font-size: 18px; max-width: 60ch; }
@media (max-width: 700px) {
  .section { padding: 72px 0; }
  .section__head { margin-bottom: 36px; }
}

/* ---------- services ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.service {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 32px 28px; display: flex; flex-direction: column; gap: 14px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.service:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.service__icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.service__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.service__num { position: absolute; top: 32px; right: 28px; }
.service h3 { font-size: 23px; font-weight: 600; margin-top: 8px; }
.service > p:not(.service__num) { color: var(--ink-2); font-size: 16px; }
.checks { display: grid; gap: 10px; margin-top: 8px; padding-top: 18px; border-top: 1px dashed var(--line); }
.checks li { position: relative; padding-left: 26px; font-size: 15px; color: var(--ink-2); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .42em; width: 14px; height: 14px; border-radius: 4px;
  background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff5b1f' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center/10px no-repeat;
}
@media (max-width: 960px) { .services { grid-template-columns: 1fr; } }

/* ---------- projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -24px 0 40px; }
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  padding: 9px 16px; border-radius: 999px; cursor: pointer; font-size: 14px; font-weight: 500;
  transition: all .2s ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.projects { display: grid; gap: 28px; }
.project {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px;
  transition: opacity .3s ease, transform .3s ease;
}
.project:nth-child(even) .project__shot { order: 2; }
.project.is-hidden { display: none; }
.project__shot {
  display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line);
  background: var(--paper); box-shadow: var(--shadow); text-decoration: none;
}
.project__shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.project__shot:hover img { transform: scale(1.03); }
.browser { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.browser i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.browser span { margin-left: 10px; font: 400 12px/1 var(--f-mono); color: var(--muted); }
.project__body { display: flex; flex-direction: column; gap: 14px; padding: 8px 12px 8px 0; }
.project:nth-child(even) .project__body { padding: 8px 0 8px 12px; }
.project__type { color: var(--accent); }
.project h3 { font-size: clamp(28px, 3vw, 38px); font-weight: 700; letter-spacing: -.03em; }
.project__body > p:not(.project__type) { color: var(--ink-2); font-size: 16px; }
.link { font-weight: 600; font-size: 15px; text-decoration: none; margin-top: 4px; align-self: flex-start;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 2px no-repeat; padding-bottom: 3px; }
.link:hover { color: var(--accent); }
@media (max-width: 900px) {
  .project { grid-template-columns: 1fr; gap: 24px; padding: 16px; }
  .project:nth-child(even) .project__shot { order: 0; }
  .project__body, .project:nth-child(even) .project__body { padding: 0 4px 8px; }
}

/* ---------- stack ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.split .section__head { margin-bottom: 0; position: sticky; top: 110px; }
.stack { display: grid; gap: 16px; }
.stack__group { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.stack__group h3 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.stack__group .tags li { background: var(--paper); }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
  .split .section__head { position: static; }
}

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: s; position: relative; }
.steps li { position: relative; padding-top: 64px; }
.steps li::before { content: ""; position: absolute; top: 22px; left: 52px; right: -20px; height: 1px; background: var(--line); }
.steps li:last-child::before { display: none; }
.steps__n {
  position: absolute; top: 0; left: 0; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font: 600 16px/1 var(--f-mono);
  background: var(--card); border: 1.5px solid var(--ink);
}
.steps li:first-child .steps__n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps h3 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.steps p { color: var(--ink-2); font-size: 15.5px; }
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .steps li:nth-child(2)::before { display: none; }
}
@media (max-width: 540px) {
  .steps { grid-template-columns: 1fr; row-gap: 28px; }
  .steps li { padding: 4px 0 0 64px; }
  .steps li::before { display: none; }
}

/* ---------- contact ---------- */
.contact__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.contact__grid .section__head { margin-bottom: 0; }
.contact__info { margin-top: 32px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.contact__info li { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.contact__info span { font: 500 13px/1.8 var(--f-mono); color: var(--muted); }
.contact__info a { text-decoration: none; font-weight: 600; }
.contact__info a:hover { color: var(--accent); }

.form { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 32px; display: grid; gap: 20px; box-shadow: var(--shadow); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form label { display: grid; gap: 8px; font-size: 14px; font-weight: 600; }
.form input:not([type="radio"]), .form textarea {
  font: 400 16px/1.4 var(--f-body); color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; width: 100%;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form textarea { resize: vertical; min-height: 130px; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.form .is-invalid { border-color: #dc2626 !important; }
.form__need { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.form__need legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.pill { display: inline-flex !important; cursor: pointer; }
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill span { padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); font-weight: 500; font-size: 14px; background: var(--paper); transition: all .2s ease; }
.pill input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.form .btn { justify-self: start; }
.form__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__note.is-ok { color: #16a34a; }
.form__note.is-error { color: #dc2626; }
.form .btn[disabled] { opacity: .6; cursor: wait; transform: none; }
.form__note { font: 400 13px/1.5 var(--f-mono); color: var(--muted); }
@media (max-width: 900px) { .contact__grid { grid-template-columns: 1fr; gap: 40px; } }
@media (max-width: 540px) {
  .form { padding: 20px; }
  .form__row { grid-template-columns: 1fr; }
  .form .btn { width: 100%; justify-content: center; }
}

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 32px 0; font-size: 14px; color: var(--muted); }
.footer__inner { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.footer .brand { color: var(--ink); }
.footer a { color: var(--ink-2); }

/* ---------- legal page ---------- */
.legal { padding: 72px 0 96px; }
.legal .wrap { max-width: 760px; }
.legal h1 { font-size: clamp(36px, 5vw, 52px); margin-bottom: 32px; }
.legal h2 { font-size: 22px; margin: 40px 0 12px; }
.legal p, .legal li { color: var(--ink-2); margin-bottom: 8px; }
.legal a { color: var(--accent); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .hero__diagram .pulses { display: none; }
}
