/* ============================================================
   Pinetree IT — one-pager
   Warm & human × sleek & minimal
   ============================================================ */

:root {
  /* palette — warm cream paper, deep pine ink, clay accent */
  --paper:      oklch(0.972 0.009 95);
  --paper-2:    oklch(0.948 0.012 92);
  --ink:        oklch(0.265 0.028 158);
  --ink-soft:   oklch(0.40 0.022 158);
  --muted:      oklch(0.54 0.018 150);
  --line:       oklch(0.265 0.028 158 / 0.14);
  --pine:       oklch(0.30 0.045 158);
  --pine-deep:  oklch(0.205 0.030 160);

  /* accent — pine green */
  --accent:     oklch(0.55 0.085 158);
  --accent-ink: oklch(0.42 0.07 158);

  /* type */
  --serif: "Instrument Serif", Georgia, serif;
  --sans:  "Hanken Grotesk", system-ui, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, monospace;

  /* rhythm */
  --gutter: clamp(1.25rem, 5vw, 7rem);
  --maxw: 1240px;

  --grain: 1; /* subtle warm texture */
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: clamp(1rem, 0.6rem + 0.7vw, 1.18rem);
  line-height: 1.6;
  font-weight: 380;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* film grain overlay (tweakable) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: calc(var(--grain) * 0.045);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ---------- type ---------- */
h1, h2, h3 { font-weight: 400; margin: 0; line-height: 0.98; letter-spacing: -0.02em; }

.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 0.96;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-ink);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: "";
  width: 1.6em;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.lede { font-size: clamp(1.15rem, 0.9rem + 1vw, 1.6rem); line-height: 1.45; color: var(--ink-soft); font-weight: 380; max-width: 32ch; text-wrap: pretty; }

a { color: inherit; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
section { position: relative; }

.section-pad { padding-block: clamp(5rem, 11vw, 11rem); }

/* ---------- magnetic cursor ---------- */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9500;
  border-radius: 999px; pointer-events: none;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}
.cursor-dot { width: 7px; height: 7px; background: oklch(0.95 0 0); }
.cursor-ring {
  width: 38px; height: 38px;
  border: 1px solid oklch(0.95 0 0 / 0.7);
  transition: width .25s cubic-bezier(.22,1,.36,1), height .25s cubic-bezier(.22,1,.36,1), opacity .25s, border-color .25s;
}
.cursor-ring.is-hover { width: 64px; height: 64px; border-color: oklch(0.95 0 0); }
@media (hover: none), (pointer: coarse) { .cursor-dot, .cursor-ring { display: none; } }
body.cursor-on { cursor: none; }
body.cursor-on a, body.cursor-on button { cursor: none; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 8000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem var(--gutter);
  transition: background .4s ease, backdrop-filter .4s ease, border-color .4s ease, padding .4s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: oklch(0.972 0.009 95 / 0.72);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom-color: var(--line);
  padding-block: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; font-size: 1.05rem; }
.brand .glyph { display: block; }
.brand .glyph path, .brand .glyph polygon { fill: var(--accent); transition: fill .3s; }
.brand .word b { font-weight: 600; }
.brand .word span { color: var(--muted); font-weight: 500; }
.nav-cta {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em;
  text-decoration: none; padding: 0.5rem 0.9rem; border-radius: 999px;
  border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 0.5em;
  transition: border-color .3s, background .3s, color .3s;
}
.nav-cta:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
@media (max-width: 640px) { .nav-cta { display: none; } }

/* ---------- buttons ---------- */
.btn {
  --pad-y: 0.95rem; --pad-x: 1.6rem;
  position: relative; display: inline-flex; align-items: center; gap: 0.7em;
  font-family: var(--sans); font-size: 1rem; font-weight: 500; letter-spacing: -0.01em;
  padding: var(--pad-y) var(--pad-x); border-radius: 999px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; will-change: transform;
  transition: background .35s, color .35s, border-color .35s;
}
.btn .btn-label { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 0.6em; white-space: nowrap; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn .arrow { transition: transform .35s cubic-bezier(.22,1,.36,1); }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- hero ---------- */
.hero { min-height: 100svh; display: flex; align-items: center; padding-top: 6rem; overflow: clip; }
.hero-grid { display: grid; gap: clamp(2rem, 5vw, 4rem); width: 100%; }
.hero h1 { font-family: var(--serif); font-size: clamp(2.5rem, 1.2rem + 5.6vw, 6rem); }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: end; margin-top: 0.5rem; }
@media (min-width: 860px) {
  .hero-sub { grid-template-columns: 1.1fr 0.9fr; gap: clamp(2rem, 6vw, 6rem); }
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.6rem; }

/* floating parallax blobs */
.orb { position: absolute; border-radius: 50%; filter: blur(46px); opacity: 0.5; z-index: -1; pointer-events: none; }
.orb-1 { width: 42vw; height: 42vw; max-width: 560px; max-height: 560px; top: -8%; right: -6%; background: radial-gradient(circle at 40% 40%, var(--accent), transparent 68%); opacity: 0.28; }
.orb-2 { width: 36vw; height: 36vw; max-width: 460px; max-height: 460px; bottom: -14%; left: -10%; background: radial-gradient(circle at 50% 50%, var(--pine), transparent 66%); opacity: 0.22; }

.scroll-hint { position: absolute; bottom: 2rem; left: var(--gutter); font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 0.7em; }
.scroll-hint .bar { width: 1px; height: 34px; background: linear-gradient(var(--muted), transparent); animation: drip 2.4s ease-in-out infinite; transform-origin: top; }
@keyframes drip { 0%,100% { transform: scaleY(0.4); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }

/* ---------- marquee strip ---------- */
.strip { border-block: 1px solid var(--line); overflow: hidden; padding-block: 1.1rem; background: var(--paper-2); }
.marquee { display: flex; gap: 3rem; width: max-content; animation: slide 32s linear infinite; }
.marquee span { font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.04em; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 3rem; white-space: nowrap; }
.marquee span::after { content: "✦"; color: var(--accent); }
@keyframes slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee { animation: none; } }

/* ---------- positioning ---------- */
.statement { font-family: var(--serif); font-size: clamp(1.9rem, 1rem + 4vw, 4rem); line-height: 1.05; max-width: 18ch; letter-spacing: -0.015em; }
.statement .hl { color: var(--accent); font-style: italic; }
.position-grid { display: grid; gap: clamp(2.5rem, 6vw, 6rem); }
@media (min-width: 900px) { .position-grid { grid-template-columns: 1.4fr 1fr; align-items: end; } }
.position-meta { display: grid; gap: 1.4rem; }
.meta-item { display: grid; gap: 0.3rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.meta-item dt { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.meta-item dd { margin: 0; font-size: 1.05rem; color: var(--ink); }

/* ---------- work cards ---------- */
.work { background: var(--paper-2); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.section-head h2 { font-family: var(--serif); font-size: clamp(2.2rem, 1.2rem + 4vw, 4rem); }
.section-head p { color: var(--muted); max-width: 30ch; margin: 0; }

.cards { display: grid; gap: 1.25rem; }
@media (min-width: 560px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 920px) { .cards { grid-template-columns: repeat(3, 1fr); } }

.card {
  position: relative; background: var(--paper); border: 1px solid var(--line);
  border-radius: 20px; padding: clamp(1.6rem, 3vw, 2.2rem);
  display: flex; flex-direction: column; gap: 1.2rem; min-height: 340px;
  overflow: hidden; transform-style: preserve-3d; will-change: transform;
  transition: border-color .4s, box-shadow .4s;
}
.card::before {
  content: ""; position: absolute; inset: 0; opacity: 0;
  background: radial-gradient(420px circle at var(--mx,50%) var(--my,0%), color-mix(in oklch, var(--accent) 14%, transparent), transparent 60%);
  transition: opacity .4s; pointer-events: none;
}
.card:hover { border-color: oklch(0.265 0.028 158 / 0.30); box-shadow: 0 30px 60px -40px oklch(0.265 0.028 158 / 0.5); }
.card:hover::before { opacity: 1; }
.card .num { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.1em; color: var(--accent-ink); }
.card .ico { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); }
.card h3 { font-size: 1.4rem; font-weight: 500; letter-spacing: -0.015em; line-height: 1.1; }
.card p { color: var(--ink-soft); margin: 0; font-size: 0.98rem; line-height: 1.55; }
.card .tag { margin-top: auto; font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--muted); padding-top: 1rem; border-top: 1px dashed var(--line); }

/* ---------- process ---------- */
.process-list { display: grid; gap: 0; counter-reset: step; border-top: 1px solid var(--line); }
.step {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(1.2rem, 4vw, 3.5rem);
  padding-block: clamp(1.6rem, 4vw, 2.6rem); border-bottom: 1px solid var(--line);
  align-items: baseline; transition: padding-left .4s cubic-bezier(.22,1,.36,1);
}
@media (min-width: 760px) { .step { grid-template-columns: 5rem 0.9fr 1.4fr; } .step:hover { padding-left: 1.2rem; } }
.step .idx { font-family: var(--mono); font-size: 0.85rem; color: var(--accent-ink); }
.step h3 { font-family: var(--serif); font-size: clamp(1.6rem, 1rem + 2.4vw, 2.6rem); font-weight: 400; line-height: 1; }
.step p { color: var(--ink-soft); margin: 0.5rem 0 0; max-width: 42ch; }
@media (min-width: 760px) { .step p { margin-top: 0; } }
.step .bigline { position: relative; }
.step .bigline::after { content: ""; position: absolute; left: 0; bottom: -0.35em; height: 2px; width: 0; background: var(--accent); transition: width .5s cubic-bezier(.22,1,.36,1); }
.step:hover .bigline::after { width: 2.6em; }

/* ---------- about ---------- */
.about { background: var(--pine-deep); color: var(--paper); }
.about .eyebrow { color: oklch(0.78 0.09 60); }
.about-grid { display: grid; gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
@media (min-width: 860px) { .about-grid { grid-template-columns: 0.8fr 1.2fr; } }
.about h2 { font-family: var(--serif); font-size: clamp(1.9rem, 1.2rem + 3vw, 3.4rem); line-height: 1.06; }
.about p { color: oklch(0.86 0.02 95); max-width: 46ch; }
.about p + p { margin-top: 1.1rem; }
.about .sig { font-family: var(--serif); font-style: italic; font-size: 1.5rem; color: oklch(0.78 0.09 60); margin-top: 1.4rem; }
.portrait { display: block; width: 100%; height: clamp(380px, 42vw, 540px); border-radius: 18px; overflow: hidden; object-fit: cover; object-position: 50% 30%; }

/* ---------- contact ---------- */
.contact { text-align: center; }
.contact h2 { font-family: var(--serif); font-size: clamp(2.6rem, 1.2rem + 7vw, 7rem); line-height: 0.98; }
.contact h2 em { font-style: italic; color: var(--accent); }
.email-btn {
  --pad-y: 1.15rem; --pad-x: 2rem; margin-top: 2.4rem; font-size: 1.1rem;
}
.contact .sub { color: var(--muted); margin: 1.4rem auto 0; max-width: 40ch; }
.copy-note { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--accent-ink); margin-top: 1rem; min-height: 1.2em; transition: opacity .3s; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding-block: 2.6rem; }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em; color: var(--muted); }
.footer a { text-decoration: none; transition: color .3s; }
.footer a:hover { color: var(--accent); }

/* ---------- scroll reveal ----------
   Content is VISIBLE by default. The hidden pre-animation state only
   applies once JS adds .reveal-ready to <html>, so if JS never runs
   (or an observer misfires) nothing is ever stuck invisible. */
.reveal { transition: opacity .9s cubic-bezier(.22,1,.36,1), transform .9s cubic-bezier(.22,1,.36,1); }
.reveal-ready .reveal { opacity: 0; transform: translateY(26px); }
.reveal-ready .reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal-ready .reveal { opacity: 1 !important; transform: none !important; }
  .orb { display: none; }
}

/* word-by-word hero reveal — fade + rise, no clip (so italic glyphs aren't cut) */
.word-rise { display: inline-block; margin-right: 0.26em; }
.word-rise > span { display: inline-block; transition: transform .85s cubic-bezier(.22,1,.36,1), opacity .85s ease; }
.reveal-ready .word-rise > span { transform: translateY(0.5em); opacity: 0; }
.reveal-ready .hero.in .word-rise > span { transform: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .reveal-ready .word-rise > span { transform: none !important; opacity: 1 !important; } }

/* ============================================================
   RESPONSIVE — tablet & phone
   Same vibe & colors, calmer motion, everything stacks cleanly.
   ============================================================ */

/* Tablet and below */
@media (max-width: 900px) {
  .section-pad { padding-block: clamp(4rem, 10vw, 7rem); }
  .hero { min-height: 94svh; }
}

/* Phones */
@media (max-width: 760px) {
  .section-pad { padding-block: clamp(3.25rem, 12vw, 5rem); }

  /* hero */
  .hero { padding-top: 5.5rem; min-height: auto; padding-bottom: 3.5rem; }
  .hero h1 { font-size: clamp(2.5rem, 1rem + 11vw, 4rem); }
  .hero-sub { gap: 1.6rem; }
  .lede { max-width: none; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .scroll-hint { display: none; }

  /* softer / smaller blurred orbs so paint stays cheap on phones */
  .orb { filter: blur(34px); opacity: 0.2; }

  /* positioning */
  .statement { max-width: none; }

  /* process steps stack: label, title, copy */
  .step { grid-template-columns: 1fr; gap: 0.45rem; padding-block: 1.7rem; align-items: start; }
  .step .idx { order: -1; }
  .step h3 { font-size: clamp(1.9rem, 1rem + 7vw, 2.6rem); }
  .step p { max-width: none; }

  /* about */
  .portrait { height: clamp(320px, 78vw, 460px); }

  /* contact */
  .contact h2 { font-size: clamp(2.6rem, 1rem + 12vw, 4.4rem); }
  .email-btn { width: 100%; justify-content: center; }

  /* footer wraps to its own lines, left-aligned */
  .footer .wrap { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

/* Small phones */
@media (max-width: 420px) {
  :root { --gutter: 1.25rem; }
  .nav { padding-inline: 1.25rem; }
  .hero h1 { font-size: clamp(2.2rem, 0.8rem + 10vw, 3.4rem); }
  .card { min-height: 0; }
}

/* Anything with a coarse pointer: kill the custom cursor + hover-only transforms */
@media (hover: none), (pointer: coarse) {
  body.cursor-on { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none !important; }
  .card:hover { transform: none !important; }
}
