/* ============================================================
   GranRoca — granroca.com
   Editorial minimalism. Paper ground · Ink text · One ochre accent
   Type: Fraunces (display serif) · Inter (text/utility)
   ============================================================ */

:root {
  --paper: #f7f5f0;
  --paper-2: #efece4;
  --ink: #211d18;
  --ink-soft: #3a352d;
  --muted: #736b5f;
  --faint: #a8a092;
  --accent: #b54a22;
  --line: rgba(33, 29, 24, 0.14);
  --line-soft: rgba(33, 29, 24, 0.08);

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;

  --pad-x: clamp(1.4rem, 5.5vw, 6rem);
  --maxw: 1320px;
  --measure: 60ch;
}

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--paper); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 1px; }
img, svg { display: block; max-width: 100%; }

/* ---- reading progress hairline ---- */
.progress {
  position: fixed; inset: 0 0 auto 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 80;
  pointer-events: none;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: fixed; inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem var(--pad-x);
  transition: padding 0.4s ease, background-color 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  padding-top: 1rem;
  padding-bottom: 1rem;
  background: rgba(247, 245, 240, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
}
.brand { display: flex; align-items: center; }
.brand img { height: 33px; width: auto; }

.site-nav { display: flex; align-items: center; gap: clamp(1.2rem, 3vw, 2.6rem); }
.site-nav a {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
  transition: color 0.25s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.nav-cta {
  color: var(--paper);
  background: var(--ink);
  padding: 0.6em 1.25em;
  border-radius: 999px;
  transition: background-color 0.3s ease;
}
.site-nav a.nav-cta:hover { background: var(--accent); }

/* ============================================================
   Reveal scaffolding (JS adds .js; without JS everything visible)
   ============================================================ */
.js .rev { opacity: 0; }
.line { display: block; overflow: hidden; }
.line-in { display: block; will-change: transform; }

/* ============================================================
   Hero — editorial type as the centerpiece
   ============================================================ */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.8rem, 4vw, 3rem);
  padding: 8rem var(--pad-x) 4rem;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line-soft);
}
.hero-eyebrow, .hero-meta {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-eyebrow { color: var(--accent); }
.hero-meta { color: var(--faint); }
.hero-eyebrow .rev, .hero-meta .rev { display: inline-block; }

.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.2rem, 12vw, 11rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  font-optical-sizing: auto;
}
.hero-title em {
  position: relative;
  font-style: italic;
  color: var(--accent);
}
.hero-title .ul {
  position: absolute;
  left: 0; right: 0;
  bottom: 0.08em;
  height: 0.055em;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
}

.hero-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: end;
  padding-top: clamp(1rem, 3vw, 2rem);
  border-top: 1px solid var(--line-soft);
}
.hero-sub {
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 46ch;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.4rem;
  justify-self: start;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.95em 1.7em;
  border-radius: 999px;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--accent); transform: translateY(-2px); }

.link-arrow {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  white-space: nowrap;
}
.link-arrow span { transition: transform 0.3s ease; color: var(--accent); }
.link-arrow:hover span { transform: translateX(4px); }

/* ============================================================
   Section scaffolding
   ============================================================ */
.section {
  position: relative;
  padding: clamp(5rem, 11vw, 9.5rem) var(--pad-x);
  max-width: var(--maxw);
  margin: 0 auto;
}
.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}
.eyebrow.rev { display: inline-block; }
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.3rem, 5.6vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
}

/* ============================================================
   Work — channels as an editorial index
   ============================================================ */
.channel-list {
  list-style: none;
  border-top: 1px solid var(--line);
}
.channel { border-bottom: 1px solid var(--line); }
.channel a {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
  padding: clamp(1.6rem, 3.4vw, 2.6rem) clamp(0.5rem, 2vw, 1.5rem);
  isolation: isolate;
}
/* ochre wipe from the left on hover */
.channel a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: -1;
}
.channel a:hover::before, .channel a:focus-visible::before { transform: scaleX(1); }

.channel-idx {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  transition: color 0.4s ease;
}
.channel-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.8rem, 4.8vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  transition: color 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.channel-tags {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color 0.4s ease;
}
.channel-era {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.4s ease;
}
.channel-go {
  font-size: 1.3rem;
  color: var(--faint);
  transition: color 0.4s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.channel a:hover .channel-name,
.channel a:hover .channel-tags,
.channel a:hover .channel-era,
.channel a:hover .channel-idx,
.channel a:hover .channel-go,
.channel a:focus-visible .channel-name,
.channel a:focus-visible .channel-tags,
.channel a:focus-visible .channel-era,
.channel a:focus-visible .channel-idx,
.channel a:focus-visible .channel-go { color: var(--paper); }
.channel a:hover .channel-name { transform: translateX(10px); }
.channel a:hover .channel-go { transform: translate(6px, -6px); color: var(--paper); }

/* ============================================================
   Approach
   ============================================================ */
.approach { border-top: 1px solid var(--line-soft); }
.approach-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: start;
}
.approach-intro p:not(.eyebrow) {
  margin-top: 1.4rem;
  color: var(--muted);
  max-width: 40ch;
}
.approach-steps {
  list-style: none;
  display: grid;
  gap: 0;
}
.approach-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1rem, 3vw, 2.4rem);
  align-items: baseline;
  padding: clamp(1.4rem, 3vw, 2rem) 0;
  border-top: 1px solid var(--line-soft);
}
.approach-step:last-child { border-bottom: 1px solid var(--line-soft); }
.step-no {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.approach-step h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}
.approach-step p { color: var(--muted); max-width: 52ch; }

/* ============================================================
   Studio
   ============================================================ */
.studio {
  background: var(--paper-2);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  max-width: none;
}
.studio > * { max-width: var(--maxw); margin-inline: auto; }
.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: start;
}
.studio-statement {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}
.studio-body p {
  color: var(--ink-soft);
  font-size: 1.08rem;
  max-width: 50ch;
}
.studio-body p + p { margin-top: 1.2rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: clamp(3rem, 7vw, 5.5rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
}
.stat dd {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.8rem, 6vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat dt {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* ============================================================
   Contact
   ============================================================ */
.contact { text-align: center; padding-block: clamp(6rem, 13vw, 11rem); }
.contact-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 6.5rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin-bottom: clamp(1.6rem, 4vw, 2.6rem);
}
.contact-mail {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.4rem, 3.4vw, 2.4rem);
  color: var(--accent);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size 0.4s ease;
}
.contact-mail:hover { background-size: 100% 2px; }
.contact-note { margin-top: 1.4rem; color: var(--muted); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  padding: clamp(3rem, 5vw, 4.5rem) var(--pad-x) 2.2rem;
  border-top: 1px solid var(--line-soft);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2.5rem;
  max-width: var(--maxw);
  margin: 0 auto;
}
.site-footer .brand img { height: 31px; }
.footer-nav { display: grid; gap: 0.6rem; align-content: start; }
.footer-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.8rem;
}
.footer-nav a { font-size: 0.92rem; color: var(--muted); transition: color 0.25s ease; }
.footer-nav a:hover { color: var(--ink); }
.footer-meta {
  max-width: var(--maxw);
  margin: clamp(2.5rem, 5vw, 4rem) auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.8rem;
  color: var(--faint);
}

/* ============================================================
   404
   ============================================================ */
.page-404 {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem var(--pad-x) 4rem;
  max-width: var(--maxw);
  margin: 0 auto;
}
.page-404 .logo-404 { height: 40px; width: auto; margin-bottom: 2.5rem; }
.code-404 {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.4rem;
}
.page-404 h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 5.5rem);
  line-height: 1.0;
  letter-spacing: -0.03em;
  max-width: 14ch;
}
.page-404 h1 em { font-style: italic; color: var(--accent); }
.page-404 p { color: var(--muted); max-width: 42ch; margin: 1.6rem auto 2.6rem; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .hero { min-height: auto; padding-top: 8rem; gap: 2rem; }
  .hero-bottom { grid-template-columns: 1fr; gap: 1.8rem; }
  .approach-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .studio-grid { grid-template-columns: 1fr; gap: 2rem; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 2.2rem; }
  .channel a {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "idx body go" "idx era era";
    row-gap: 0.4rem;
  }
  .channel-idx { grid-area: idx; }
  .channel-body { grid-area: body; }
  .channel-era { grid-area: era; }
  .channel-go { grid-area: go; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .site-nav a:not(.nav-cta) { display: none; }
  .brand img { height: 28px; }
  .hero-meta { display: none; }
  .footer-grid { flex-direction: column; gap: 2rem; }
  .channel a { grid-template-columns: auto 1fr; grid-template-areas: "idx body" "idx era"; }
  .channel-go { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .js .rev { opacity: 1; }
  .hero-title .ul { transform: scaleX(1); }
}
