/* ============================================================
   AtScale Solutions — minimal & premium design system
   ============================================================ */

@import url("https://fonts.bunny.net/css?family=fraunces:400,400i,500,500i,600,600i|inter:400,500,600&display=swap");

:root {
  --paper: #f6f4ef;
  --paper-deep: #efece4;
  --ink: #171410;
  --ink-soft: #45403a;
  --muted: #6f695e;
  --line: #dcd7cb;
  --accent: #9a7b4f;
  --accent-ink: #7d6238;
  --white: #fffdf9;
  --max: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --radius: 2px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--paper); }

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- typography ---------- */

h1, h2, h3, .serif {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 480;
  letter-spacing: -0.015em;
  line-height: 1.08;
}

.display {
  font-size: clamp(2.6rem, 6.4vw, 5.4rem);
  font-weight: 460;
}

.display em, h2 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent-ink);
}

h2.section-title {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  max-width: 18em;
}

h3 { font-size: 1.35rem; }

.kicker {
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.kicker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--accent);
}

.lede {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 34em;
}

.body-muted { color: var(--muted); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.wordmark {
  font-family: "Fraunces", serif;
  font-size: 1.28rem;
  font-weight: 560;
  letter-spacing: -0.01em;
}

.wordmark sup {
  font-size: 0.55em;
  color: var(--accent-ink);
  margin-left: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a:not(.btn) {
  font-size: 0.92rem;
  color: var(--ink-soft);
  position: relative;
  padding: 4px 0;
  transition: color 0.25s var(--ease);
}

.nav-links a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}

.nav-links a:not(.btn):hover { color: var(--ink); }
.nav-links a:not(.btn):hover::after,
.nav-links a:not(.btn).active::after { transform: scaleX(1); transform-origin: left; }
.nav-links a:not(.btn).active { color: var(--ink); }

/* buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 13px 26px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}

.btn:hover { background: transparent; color: var(--ink); transform: translateY(-1px); }

.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

.btn .arrow { transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

/* mobile nav */

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  margin: 5px 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    inset: 72px 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 12px var(--gutter) 28px;
    transform: translateY(-120%);
    transition: transform 0.4s var(--ease);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links li { width: 100%; border-bottom: 1px solid var(--line); }
  .nav-links li:last-child { border-bottom: none; padding-top: 16px; }
  .nav-links a:not(.btn) { display: block; padding: 16px 0; font-size: 1.05rem; }
  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}

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

section { padding: clamp(72px, 10vw, 128px) 0; }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: clamp(40px, 6vw, 72px);
}

.section-head.split {
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  flex-wrap: wrap;
}

.rule { border: none; border-top: 1px solid var(--line); }

/* hero */

.hero { padding: clamp(88px, 12vw, 160px) 0 clamp(64px, 9vw, 120px); }

.hero .display { max-width: 13em; margin: 28px 0 32px; }

.hero-meta {
  display: flex;
  gap: clamp(24px, 5vw, 64px);
  flex-wrap: wrap;
  margin-top: clamp(48px, 7vw, 88px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.hero-meta .stat b {
  font-family: "Fraunces", serif;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 520;
  display: block;
}

.hero-meta .stat span {
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* marquee-ish client strip */

.clients {
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-deep);
}

.clients .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.clients span {
  font-family: "Fraunces", serif;
  font-size: 1.02rem;
  font-style: italic;
  color: var(--muted);
  white-space: nowrap;
}

/* service list (index preview + services page) */

.service-list { list-style: none; border-top: 1px solid var(--line); counter-reset: svc; }

.service-row {
  display: grid;
  grid-template-columns: 64px 1.1fr 1.6fr auto;
  gap: clamp(16px, 3vw, 48px);
  align-items: baseline;
  padding: clamp(24px, 4vw, 40px) 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.3s var(--ease);
}

.service-row:hover { background: color-mix(in srgb, var(--paper-deep) 60%, transparent); }

.service-row .num {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.service-row h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }

.service-row p { color: var(--muted); font-size: 0.98rem; max-width: 34em; }

.service-row .tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.tag {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--white);
}

@media (max-width: 860px) {
  .service-row { grid-template-columns: 44px 1fr; row-gap: 10px; }
  .service-row > div, .service-row .row-cta { grid-column: 2; }
  .service-row .row-cta { justify-self: start; padding: 4px 0; }
}

/* work grid */

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 3.5vw, 48px);
}

.work-card { display: flex; flex-direction: column; gap: 18px; }

.work-card .thumb {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: var(--paper-deep);
}

.work-card .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, transparent 55%, rgba(23, 20, 16, 0.06));
}

.work-card .thumb svg { width: 100%; height: 100%; display: block; }

.work-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.work-card h3 { font-size: 1.25rem; }

.work-card .cat { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

.work-card .result { color: var(--muted); font-size: 0.95rem; }

.work-card .result b { color: var(--accent-ink); font-weight: 600; }

@media (max-width: 760px) { .work-grid { grid-template-columns: 1fr; } }

/* approach / numbered steps */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 48px);
}

.step {
  border-top: 1px solid var(--ink);
  padding-top: 22px;
}

.step .num {
  font-family: "Fraunces", serif;
  font-style: italic;
  color: var(--accent-ink);
  font-size: 1rem;
}

.step h3 { margin: 10px 0 10px; font-size: 1.2rem; }

.step p { color: var(--muted); font-size: 0.95rem; }

@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* quote */

.quote { background: var(--ink); color: var(--paper); }

.quote blockquote {
  font-family: "Fraunces", serif;
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
  font-weight: 420;
  line-height: 1.3;
  max-width: 24em;
}

.quote blockquote em { color: var(--accent); font-style: italic; }

.quote figcaption {
  margin-top: 28px;
  font-family: "Inter", sans-serif;
  font-size: 0.88rem;
  color: color-mix(in srgb, var(--paper) 70%, transparent);
  letter-spacing: 0.03em;
}

/* CTA band */

.cta-band { text-align: left; }

.cta-band .inner {
  border-top: 1px solid var(--ink);
  padding-top: clamp(40px, 6vw, 64px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  flex-wrap: wrap;
}

.cta-band h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); max-width: 14em; }

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

.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(56px, 8vw, 96px) 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1.4fr;
  gap: clamp(32px, 5vw, 64px);
  margin-bottom: clamp(48px, 7vw, 80px);
}

.site-footer .wordmark { color: var(--paper); font-size: 1.5rem; }

.site-footer p { color: color-mix(in srgb, var(--paper) 62%, transparent); font-size: 0.92rem; max-width: 26em; }

.site-footer h4 {
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--paper) 45%, transparent);
  margin-bottom: 18px;
}

.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }

.site-footer ul a {
  color: color-mix(in srgb, var(--paper) 78%, transparent);
  font-size: 0.94rem;
  transition: color 0.25s var(--ease);
}

.site-footer ul a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid color-mix(in srgb, var(--paper) 14%, transparent);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: color-mix(in srgb, var(--paper) 50%, transparent);
}

@media (max-width: 1150px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- inner pages ---------- */

.page-hero { padding: clamp(72px, 9vw, 120px) 0 clamp(48px, 6vw, 80px); }

.page-hero .display { max-width: 14em; margin: 26px 0 26px; }

/* values */

.values-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 3vw, 48px);
}

.value {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius);
  padding: clamp(24px, 3.4vw, 40px);
}

.value h3 { margin-bottom: 10px; }
.value p { color: var(--muted); font-size: 0.96rem; }

@media (max-width: 760px) { .values-grid { grid-template-columns: 1fr; } }

/* team */

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 44px);
}

.person .portrait {
  aspect-ratio: 3 / 3.4;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.person .portrait svg { width: 100%; height: 100%; }

.person h3 { font-size: 1.1rem; }
.person span { font-size: 0.85rem; color: var(--muted); }

@media (max-width: 760px) { .team-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .team-grid { grid-template-columns: 1fr; } }

/* contact */

.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.contact-line { display: flex; flex-direction: column; gap: 6px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.contact-line span { font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.contact-line a, .contact-line p { font-family: "Fraunces", serif; font-size: clamp(1.2rem, 2vw, 1.55rem); }
.contact-line a:hover { color: var(--accent-ink); }

form.contact-form { display: flex; flex-direction: column; gap: 22px; }

.field { display: flex; flex-direction: column; gap: 8px; }

.field label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.field input, .field textarea, .field select {
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.field textarea { min-height: 140px; resize: vertical; }

/* reveal on scroll */

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* focus visibility */

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* skip link */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 100;
}

.skip-link:focus { left: 12px; }


/* ---------- mobile hardening ---------- */

body { overflow-x: clip; }

.contact-line a, .site-footer ul a { overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; gap: 44px; }
}

@media (max-width: 520px) {
  .display { font-size: clamp(2.1rem, 8.8vw, 2.6rem); }
  h2.section-title { font-size: clamp(1.6rem, 7vw, 1.9rem); }
  .cta-band h2 { font-size: clamp(1.6rem, 7vw, 2rem); }
  .lede { font-size: 1.02rem; }
  .service-row h3 { font-size: 1.25rem; }
  .section-head.split { flex-direction: column; align-items: flex-start; gap: 20px; }
  .cta-band .inner { flex-direction: column; align-items: flex-start; gap: 24px; }
  .contact-line a, .contact-line p { font-size: 1.15rem; }
}
