/* ============================================================
   Tatiana Rocca — Portfolio · shared styles
   tokens · base · nav · hero · about · tools · contact
   ============================================================ */

/* ── Tokens ────────────────────────────────────────────────── */
:root {
  --color-bg:      #F4EEE3;
  --color-bg-2:    #ECE3D2;
  --color-ink:     #14110F;
  --color-muted:   #6B6357;
  --color-rule:    #DCD3C2;
  --color-accent:  #B5552E;

  --font-display:  "Bricolage Grotesque", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-body:     "Inter", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-mono:     ui-monospace, "SF Mono", Menlo, monospace;

  --fs-hero:   clamp(56px, 9vw, 144px);
  --fs-h1:     clamp(40px, 6vw,  88px);
  --fs-h2:     clamp(28px, 3.6vw, 48px);
  --fs-h3:     clamp(22px, 2.2vw, 28px);
  --fs-body:   17px;
  --fs-small:  13px;

  --space-section: clamp(96px, 14vh, 200px);
  --gutter:        clamp(24px, 4vw, 64px);
  --maxw:          1440px;

  --radius:    2px;
  --radius-md: 8px;
  --radius-lg: 20px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur:  600ms;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background: var(--color-bg);
  color: var(--color-ink);
}
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.5;
  font-weight: 400;
  overflow-x: hidden;
  background: var(--color-bg);
}
/* Cap heading weight at medium — never go bold. UA default is 700. */
h1, h2, h3, h4, h5, h6 { font-weight: 500; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* selection */
::selection { background: var(--color-accent); color: var(--color-bg); }

/* container helper */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Display + sans utilities */
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; line-height: 0.95; }
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-weight: 500;
}
.accent { color: var(--color-accent); }
.muted  { color: var(--color-muted); }

/* Reveal-on-scroll primitive (used by main.js IntersectionObserver) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ── Nav ───────────────────────────────────────────────────── */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  background: transparent;
  transition: transform 400ms var(--ease), background-color 300ms ease, border-color 300ms ease, backdrop-filter 300ms ease;
  border-bottom: 1px solid transparent;
}
.site-nav.is-scrolled {
  background: color-mix(in srgb, var(--color-bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom-color: var(--color-rule);
}
.site-nav.is-hidden { transform: translateY(-100%); }

.site-nav__inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-nav__brand {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  font-size: 22px;
  color: var(--color-accent);
}
.site-nav__links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0; padding: 0;
  font-size: 14px;
  font-weight: 500;
}
.site-nav__links a {
  position: relative;
  padding: 6px 0;
  opacity: 0.78;
  transition: opacity 200ms ease, color 200ms ease;
}
.site-nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 320ms var(--ease);
}
.site-nav__links a:hover { opacity: 1; color: var(--color-accent); }
.site-nav__links a:hover::after { transform: scaleX(1); }

@media (max-width: 720px) {
  .site-nav__links { display: none; }
}

/* ── Hero · stage ──────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  background: var(--color-bg);
  color: var(--color-ink);
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 112px var(--gutter) 32px;
  overflow: hidden;
  cursor: none;                   /* nib replaces system cursor over the hero */
}

/* Dotted-paper texture with a soft vignette toward the edges */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(20, 17, 15, 0.10) 1px, transparent 1.4px);
  background-size: 22px 22px;
  background-position: 0 0;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at center, #000 35%, transparent 92%);
          mask-image: radial-gradient(ellipse 70% 70% at center, #000 35%, transparent 92%);
  pointer-events: none;
}

/* Sketching canvas sits behind the text, above the paper texture */
.hero__ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Custom calligraphy cursor — a small outline circle */
.hero__nib {
  position: fixed;
  top: 0; left: 0;
  width: 12px;
  height: 12px;
  background: transparent;
  border: 1.5px solid var(--color-ink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 60;                    /* above the fixed nav so it's never clipped */
  opacity: 0;
  transform: translate3d(-9999px, -9999px, 0);
  transform-origin: center;
  transition: opacity 180ms var(--ease);
  will-change: transform, opacity;
}
.hero__nib.is-visible { opacity: 1; }

.hero__bottom {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 24px;
  font-size: var(--fs-small);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.hero__stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(20px, 2.4vw, 32px);
  padding-bottom: clamp(40px, 8vh, 96px); /* anchor slightly above optical center */
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-hero);
  line-height: 0.88;
  letter-spacing: -0.02em;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.28em;
}
.hero__title em {
  font-style: normal;
  color: var(--color-accent);
}
/* Word-level clip-mask for the entry stagger */
.hero__title .word {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.08em;   /* room for descenders inside the mask */
  line-height: 1;
}
.hero__title .word > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.hero.is-loaded .hero__title .word > span { transform: translateY(0); }
.hero.is-loaded .hero__title .word:nth-child(1) > span { transition-delay: 200ms; }
.hero.is-loaded .hero__title .word:nth-child(2) > span { transition-delay: 320ms; }

.hero__line {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: color-mix(in srgb, var(--color-ink) 70%, var(--color-muted) 30%);
  margin: 4px 0 0;
  max-width: 28ch;
  text-wrap: balance;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms var(--ease) 480ms, transform 600ms var(--ease) 480ms;
}
.hero.is-loaded .hero__line { opacity: 1; transform: none; }

.hero__sub {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.2vw, 17px);
  color: var(--color-muted);
  margin: 0;
  letter-spacing: -0.005em;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms var(--ease) 640ms, transform 500ms var(--ease) 640ms;
}
.hero.is-loaded .hero__sub { opacity: 1; transform: none; }

.hero__scrollcue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 500;
}
.hero__scrollcue .line {
  width: 36px; height: 1px;
  background: var(--color-accent);
  display: inline-block;
  animation: cue 1.8s var(--ease) infinite;
  transform-origin: left center;
}
@keyframes cue {
  0%, 100% { transform: scaleX(0.5); opacity: 0.6; }
  50%      { transform: scaleX(1);   opacity: 1;   }
}

/* Bottom band fades up on load */
.hero__bottom {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 500ms var(--ease) 700ms, transform 500ms var(--ease) 700ms;
}
.hero.is-loaded .hero__bottom { opacity: 1; transform: none; }

@media (max-width: 640px) {
  .hero { padding: 96px var(--gutter) 28px; }
  .hero__bottom {
    justify-content: flex-end;
  }
}

/* Touch / coarse pointer: restore system cursor, no nib, no canvas */
@media (hover: none), (pointer: coarse) {
  .hero { cursor: default; }
  .hero__ink,
  .hero__nib { display: none; }
}

/* Reduced motion: show final state, no entry animation, no sketching */
@media (prefers-reduced-motion: reduce) {
  .hero { cursor: default; }
  .hero__ink,
  .hero__nib { display: none; }
  .hero__bottom,
  .hero__line,
  .hero__sub {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero__title .word > span { transform: none; transition: none; }
  .hero__scrollcue .line { animation: none; }
}

/* ── Section header pattern ────────────────────────────────── */
.section {
  padding: var(--space-section) 0;
}
.section__head {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: var(--gutter);
  margin-bottom: clamp(48px, 8vh, 96px);
  align-items: end;
}
.section__head--solo { grid-template-columns: 1fr; }
@media (max-width: 720px) {
  .section__head { grid-template-columns: 1fr; gap: 16px; }
}
.section__index {
  font-size: var(--fs-small);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.section__index .num { color: var(--color-accent); margin-right: 6px; }
.section__title {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  line-height: 1;
  margin: 0;
  letter-spacing: -0.015em;
}

/* ── About ─────────────────────────────────────────────────── */
.about__grid {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: var(--gutter);
  align-items: start;
}
.about__grid--solo { grid-template-columns: 1fr; }
@media (max-width: 720px) { .about__grid { grid-template-columns: 1fr; } }
.about__body {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1.18;
  letter-spacing: -0.005em;
  margin: 0;
}
.about__meta {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 14px;
  color: var(--color-muted);
}
.about__meta .pip {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--color-rule);
}
.about__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  font-size: var(--fs-small);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.about__cta::after { content: "→"; transition: transform 240ms var(--ease); }
.about__cta:hover::after { transform: translateX(4px); }

/* ── Tools · marquee strip ─────────────────────────────────── */
.tools {
  background: var(--color-bg-2);
  border-top: 1px solid var(--color-rule);
  border-bottom: 1px solid var(--color-rule);
  padding: 56px 0 64px;
}
.tools__head {
  max-width: var(--maxw);
  margin: 0 auto 28px;
  padding: 0 var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
}
.tools__label {
  font-size: var(--fs-small);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.tools__caption {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 28px);
  color: var(--color-ink);
}
.marquee {
  position: relative;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.marquee__track {
  display: flex;
  gap: 64px;
  width: max-content;
  animation: marquee 42s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  display: inline-flex;
  align-items: center;
  height: 64px;
  padding: 0 4px;
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-ink);
  opacity: 0.55;
  white-space: nowrap;
  transition: opacity 240ms ease, color 240ms ease;
}
.marquee__item:hover { opacity: 1; color: var(--color-accent); }
/* Optional dividing dot between items */
.marquee__item + .marquee__item::before {
  content: "·";
  margin-right: 64px;
  margin-left: -32px;
  opacity: 0.4;
  color: var(--color-ink);
  font-weight: 400;
  align-self: center;
}
/* Logo variant: render brand-colored SVGs as <img>. Full opacity always (these are
   the marquee's content, not a label) — the dot separator stays visible since the
   <img> is wrapped, not the item itself. */
.marquee__item--icon {
  padding: 0;
  opacity: 1;
}
.marquee__logo {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  transition: transform 240ms var(--ease);
}
.marquee__item--icon:hover .marquee__logo { transform: scale(1.08); }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
}

/* ── Contact ───────────────────────────────────────────────── */
.contact {
  min-height: 80svh;
  padding: var(--space-section) 0 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.contact__line {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 128px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0 0 64px;
  max-width: 14ch;
}
.contact__line em { font-style: normal; color: var(--color-accent); }
.contact__links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  border-top: 1px solid var(--color-rule);
  padding-top: 32px;
}
.contact__link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 0;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  transition: color 220ms ease, transform 220ms var(--ease);
}
.contact__link .label {
  font-size: var(--fs-small);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-weight: 500;
}
.contact__link:hover { color: var(--color-accent); transform: translateX(4px); }

.site-foot {
  border-top: 1px solid var(--color-rule);
  padding: 24px var(--gutter);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: var(--fs-small);
  color: var(--color-muted);
}
@media (max-width: 540px) {
  .site-foot { flex-direction: column; }
}
