/* ============================================================
   Quantum Quill Technologies Ltd — site styles
   Ink & paper minimalism. Signature: the ink line that draws
   itself — a quill's stroke running through the whole site.
   Motion tokens follow the project's animation skill audit:
   strong ease-out entrances, transform/opacity only,
   hover gated to fine pointers, reduced-motion keeps fades.
   ============================================================ */

:root {
  --paper: #faf9f6;
  --paper-deep: #f3f1ec;
  --wash: #edeaff;
  --ink: #1a1a1f;
  --ink-soft: #3a3a44;
  --muted: #6e6e7a;
  --line: #e4e1d8;
  --accent: #4b3fd4;
  --accent-ink: #3a30ab;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --w-max: 68rem;
  --pad-x: clamp(1.25rem, 5vw, 3rem);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff; }

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

a { color: inherit; }

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

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

.overline {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.overline::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--accent);
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.accent-i {
  font-style: italic;
  color: var(--accent);
}

/* ---------- ink illustration language ---------- */

.ink-illo .s  { stroke: var(--ink); stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ink-illo .sa { stroke: var(--accent); stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ink-illo .sf { stroke: var(--ink); stroke-width: 1.7; fill: var(--paper); stroke-linecap: round; stroke-linejoin: round; }
.ink-illo .w  { fill: var(--wash); stroke: none; }
.ink-illo .t  { font-family: var(--mono); font-size: 11px; fill: var(--muted); }

/* caret blink inside the hero editor */
.ink-illo .caret {
  fill: var(--accent);
  animation: caret-blink 1.1s steps(2, jump-none) infinite;
}

@keyframes caret-blink { 50% { opacity: 0; } }

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

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

.site-header.is-scrolled { border-bottom-color: var(--line); }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.wordmark svg { width: 1.5rem; height: 1.5rem; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.25rem);
}

.site-nav a {
  text-decoration: none;
  font-size: 0.9375rem;
  color: var(--ink-soft);
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover { color: var(--ink); }

.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.nav-cta {
  border: 1px solid var(--ink) !important;
  border-radius: 999px;
  padding: 0.45rem 1.1rem !important;
  color: var(--ink) !important;
  transition: background 0.2s ease, color 0.2s ease !important;
}

.nav-cta:hover {
  background: var(--ink);
  color: var(--paper) !important;
}

@media (max-width: 560px) {
  .nav-cta { display: none; }
}

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

.hero {
  padding: clamp(3.5rem, 9vh, 6.5rem) 0 clamp(3rem, 8vh, 5.5rem);
}

.hero-grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 920px) {
  .hero-grid { grid-template-columns: 1.15fr 1fr; gap: 4rem; }
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.2rem);
}

/* masked word reveal: .wm is the mask line, .hw the word */
.hero h1 .wm { display: inline-block; overflow: hidden; vertical-align: bottom; }
.hero h1 .hw { display: inline-block; }

html.js.gsap .hero h1 .hw { transform: translateY(110%); }
html.js.gsap .hero .lede,
html.js.gsap .hero .hero-actions,
html.js.gsap .hero .overline { opacity: 0; }

.hero .lede {
  margin-top: 1.75rem;
  max-width: 32em;
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  color: var(--ink-soft);
}

.hero .overline { margin-bottom: 1.5rem; }

.hero-actions {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.hero-illo { width: 100%; height: auto; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 550;
  border-radius: 999px;
  padding: 0.8rem 1.6rem;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
              transform 160ms var(--ease-out);
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}

.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-ghost:hover { border-color: var(--ink); }

.btn svg { width: 0.9em; height: 0.9em; }

.btn .btn-arrow { transition: transform 0.25s var(--ease-out); }

@media (hover: hover) and (pointer: fine) {
  .btn:hover .btn-arrow { transform: translateX(3px); }
}

/* ---------- marquee ---------- */

.marquee {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  padding: 1.1rem 0;
  background: var(--paper-deep);
}

.marquee-track {
  display: flex;
  gap: 3rem;
  width: max-content;
  animation: marquee-roll 36s linear infinite;
}

.marquee-track span {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3rem;
}

.marquee-track span::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.45;
}

@keyframes marquee-roll {
  to { transform: translateX(-50%); }
}

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

.section {
  padding: clamp(3.5rem, 9vh, 6.5rem) 0;
  border-top: 1px solid var(--line);
}

.section.no-rule { border-top: 0; }

.section-head {
  display: grid;
  gap: 1.25rem;
  margin-bottom: clamp(2.25rem, 5vh, 3.5rem);
}

.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  max-width: 18em;
}

.section-head .sub {
  color: var(--muted);
  max-width: 36em;
}

/* ---------- services (numbered rows + icons) ---------- */

.service-list { list-style: none; }

.service-row {
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  gap: 1rem 1.75rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}

.service-row:last-child { border-bottom: 1px solid var(--line); }

.service-ico { width: 3rem; height: 3rem; color: var(--ink); }

.service-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.service-row h3 {
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  margin-bottom: 0.5rem;
}

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

@media (min-width: 720px) {
  .service-row { grid-template-columns: 3.4rem 16rem 1fr; align-items: start; }
  .service-row h3 { margin-bottom: 0; }
}

/* ---------- ink diagram band (signature scroll moment) ---------- */

.diagram-band {
  padding: clamp(3.5rem, 9vh, 6rem) 0;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(60rem 30rem at 80% 10%, color-mix(in srgb, var(--wash) 45%, transparent), transparent 70%),
    var(--paper);
}

.diagram-band .section-head { margin-bottom: 1.5rem; }

.diagram-svg { width: 100%; height: auto; }

.diagram-caption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.5rem;
  margin-top: 1.25rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------- field notes (card grid) ---------- */

.notes-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 820px) {
  .notes-grid { grid-template-columns: repeat(3, 1fr); }
}

.note-card {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out),
              border-color 0.35s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .note-card:hover {
    transform: translateY(-5px);
    border-color: #d4d0c4;
    box-shadow: 0 18px 40px -18px rgba(26, 26, 31, 0.18);
  }
}

.note-card figure {
  background: var(--paper-deep);
  border-bottom: 1px solid var(--line);
  padding: 1.4rem 1.4rem 0;
}

.note-card figure svg { width: 100%; height: auto; }

.note-body { padding: 1.4rem 1.5rem 1.6rem; }

.note-body .note-kind {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.note-body h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

.note-body p { color: var(--muted); font-size: 0.9375rem; }

/* ---------- principle cards ---------- */

.principles {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

@media (min-width: 720px) {
  .principles { grid-template-columns: repeat(3, 1fr); }
}

.principle {
  background: var(--paper);
  padding: 2rem 1.75rem 2.25rem;
}

.principle .p-mark {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
  font-size: 1.4rem;
  margin-bottom: 1.1rem;
}

.principle h3 { font-size: 1.3rem; margin-bottom: 0.6rem; }

.principle p { color: var(--muted); font-size: 0.9875rem; }

/* ---------- quote band ---------- */

.quote-band {
  padding: clamp(4rem, 12vh, 8rem) 0;
  border-top: 1px solid var(--line);
}

.quote-band blockquote {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4.2vw, 3rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.015em;
  max-width: 24em;
}

.quote-band .qw { display: inline-block; }

html.js.gsap .quote-band .qw { opacity: 0.13; }

.quote-band figcaption {
  margin-top: 1.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- process ---------- */

.process-line-wrap { margin-bottom: 2.5rem; }

.process-line { width: 100%; height: auto; color: var(--accent); }

.process {
  display: grid;
  gap: 2rem;
}

@media (min-width: 720px) {
  .process { grid-template-columns: repeat(4, 1fr); gap: 2.5rem; }
}

.step { border-top: 2px solid var(--ink); padding-top: 1.1rem; }

.step .step-num {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.step h3 { font-size: 1.15rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0; margin-bottom: 0.4rem; }

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

/* ---------- tools ---------- */

.tools-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
}

@media (min-width: 720px) {
  .tools-list { grid-template-columns: repeat(4, 1fr); }
}

.tools-list li {
  border-bottom: 1px solid var(--line);
  padding: 1.3rem 0.25rem;
  display: grid;
  gap: 0.2rem;
}

.tools-list .tool-name {
  font-family: var(--serif);
  font-size: 1.2rem;
}

.tools-list .tool-for {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}

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

.cta-band {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(3.5rem, 9vh, 6rem) 0;
  position: relative;
  overflow: hidden;
}

.cta-flourish {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  color: #35354a;
  pointer-events: none;
}

.cta-band .wrap {
  display: grid;
  gap: 2rem;
  position: relative;
}

@media (min-width: 820px) {
  .cta-band .wrap {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.cta-band h2 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  max-width: 16em;
}

.cta-band p { margin-top: 0.9rem; color: #b9b8c4; max-width: 34em; }

.cta-band .btn-primary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.cta-band .btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- prose / about ---------- */

.prose {
  max-width: 42em;
  display: grid;
  gap: 1.25rem;
  color: var(--ink-soft);
}

.prose strong { color: var(--ink); }

/* ---------- desk illustration band (about) ---------- */

.desk-band {
  border: 1px solid var(--line);
  background: var(--paper-deep);
  border-radius: 4px;
  padding: clamp(1.5rem, 4vw, 3rem);
  margin-top: 3.5rem;
}

.desk-band svg { width: 100%; height: auto; }

.desk-band figcaption {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------- timeline (about) ---------- */

.timeline {
  list-style: none;
  display: grid;
  gap: 0;
  margin-top: 1rem;
}

.timeline li {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--line);
}

.timeline li:last-child { border-bottom: 1px solid var(--line); }

.timeline .tl-date {
  font-family: var(--serif);
  font-style: italic;
  color: var(--accent);
}

.timeline h3 { font-size: 1.1rem; font-family: var(--sans); font-weight: 600; margin-bottom: 0.3rem; }

.timeline p { color: var(--muted); font-size: 0.9375rem; max-width: 38em; }

/* ---------- facts table ---------- */

.facts {
  border: 1px solid var(--line);
  background: var(--paper-deep);
  padding: 2rem 1.75rem;
  border-radius: 2px;
}

.facts dl { display: grid; gap: 1.1rem; }

.facts .fact {
  display: grid;
  gap: 0.15rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.facts .fact:last-child { border-bottom: 0; padding-bottom: 0; }

.facts dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd { font-size: 1rem; }

.about-grid { display: grid; gap: 3rem; }

@media (min-width: 900px) {
  .about-grid {
    grid-template-columns: 1.5fr 1fr;
    gap: 4.5rem;
    align-items: start;
  }
  .about-grid .facts { position: sticky; top: 6rem; }
}

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

.contact-grid { display: grid; gap: 3rem; }

@media (min-width: 900px) {
  .contact-grid { grid-template-columns: 1.4fr 1fr; gap: 4.5rem; }
}

.mail-link {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4.5vw, 2.9rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.2rem;
  transition: color 0.2s ease;
  overflow-wrap: anywhere;
}

.mail-link:hover { color: var(--accent); }

.contact-note {
  margin-top: 1.75rem;
  color: var(--muted);
  max-width: 32em;
}

.contact-aside {
  display: grid;
  gap: 2.25rem;
  align-content: start;
}

.contact-aside h3 {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.contact-aside p { color: var(--ink-soft); }

.map-figure {
  border: 1px solid var(--line);
  background: var(--paper-deep);
  border-radius: 4px;
  padding: 1.25rem;
}

.map-figure svg { width: 100%; height: auto; }

.map-figure figcaption {
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.brief-list {
  list-style: none;
  display: grid;
  gap: 0.9rem;
  max-width: 36em;
}

.brief-list li {
  display: flex;
  gap: 0.85rem;
  color: var(--ink-soft);
}

.brief-list li::before {
  content: "—";
  color: var(--accent);
  flex: none;
}

/* how-we-start mini steps */
.start-steps {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (min-width: 720px) {
  .start-steps { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.75rem 0 3rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer .wrap { display: grid; gap: 1.5rem; }

@media (min-width: 720px) {
  .footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
  }
}

.footer-nav { display: flex; gap: 1.5rem; margin-top: 0.75rem; }

@media (min-width: 720px) { .footer-nav { margin-top: 0; } }

.footer-nav a { text-decoration: none; color: var(--ink-soft); }

.footer-nav a:hover { color: var(--ink); }

.legal {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  max-width: 52em;
  line-height: 1.7;
}

/* ---------- reveal (JS-gated so no-JS users see everything) ---------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(24px);
}

html.js:not(.gsap) .reveal {
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- page transition veil (element injected by JS) ---------- */

.page-veil {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--ink);
  display: grid;
  place-items: center;
  transform: translateY(101%);
  pointer-events: none;
}

.page-veil svg { width: 3rem; height: 3rem; }

.page-veil.is-covering {
  transform: translateY(0);
  transition: transform 0.42s var(--ease-in-out);
  pointer-events: auto;
}

.page-veil.is-leaving {
  transform: translateY(-101%);
  transition: transform 0.55s var(--ease-in-out);
}

/* ---------- reduced motion: keep fades, drop movement ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  html.js .reveal { transform: none; transition: opacity 0.3s ease; }
  html.js.gsap .hero h1 .hw { transform: none; }
  html.js.gsap .hero .lede,
  html.js.gsap .hero .hero-actions,
  html.js.gsap .hero .overline { opacity: 1; }
  html.js.gsap .quote-band .qw { opacity: 1; }

  .marquee-track { animation: none; }
  .ink-illo .caret { animation: none; }
  .page-veil,
  .page-veil.is-covering,
  .page-veil.is-leaving { transition: none; transform: translateY(101%); }
  .note-card, .btn, .btn .btn-arrow { transition-duration: 0.01ms; }
}
