/* ============================
   Agencity — landing page styles
   ============================ */

:root {
  --black: #0a0a0a;
  --off-white: #f5f4f0;
  --grey: #888888;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;

  --hero-size: clamp(40px, 4.6vw, 72px);
  --reveal-size: clamp(28px, 3vw, 42px);
  --body-size: clamp(17px, 1.3vw, 22px);
  --intro-size: clamp(48px, 8vw, 120px);
}

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

html { scroll-behavior: auto; }

html, body {
  background: #000;
  color: var(--off-white);
  font-family: var(--serif);
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { position: relative; }

/* ============================
   Layer stack (back → front):
     0: #three-canvas       (Sisyphus, fixed full viewport)
     2: .content            (text panels, scrolls)
     3: .logo-overlay       (SVG ring drawing in at end)
     5: header              (top-left mark)
     999: .vignette-overlay (radial dim around the edges)
     1000: .grain-overlay   (film grain)
   ============================ */

/* ============================
   Overlays
   ============================ */

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
  animation: grainShift 8s steps(8) infinite;
}

@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-5%, -5%); }
  20%  { transform: translate(-10%, 5%); }
  30%  { transform: translate(5%, -10%); }
  40%  { transform: translate(-5%, 15%); }
  50%  { transform: translate(-10%, 5%); }
  60%  { transform: translate(15%, 0); }
  70%  { transform: translate(0, 10%); }
  80%  { transform: translate(-15%, 0); }
  90%  { transform: translate(10%, 5%); }
  100% { transform: translate(0, 0); }
}

.vignette-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
}

/* ============================
   Header / logo mark
   ============================ */

.site-header {
  position: fixed;
  top: 32px;
  left: 40px;
  z-index: 5;
  mix-blend-mode: difference;
  color: var(--off-white);
}

.logo-mark {
  height: 18px;
  width: auto;
  display: block;
}

/* ============================
   3D canvas (Sisyphus)
   ============================ */

#three-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#three-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ============================
   SVG logo overlay — drawn in at the end of scroll.
   The two circles (#headOutline + #openRing) are positioned in screen
   pixel coords by script.js. They draw in via stroke-dashoffset animation
   when the parent has .is-revealed.
   ============================ */

.logo-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 3;
}

/* Boulder disc: white FILLED circle covering the gold boulder.
   Reveals by fading in (the boulder is "covered" by the white disc). */
.logo-overlay #boulderDisc {
  opacity: 0;
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Head ring: white OPEN circle around the head.
   Reveals by drawing in via stroke-dashoffset animation.
   pathLength=100 means stroke-dasharray=100 covers the full perimeter
   regardless of the actual radius — we just animate dashoffset 100 → 0. */
.logo-overlay #headRing {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0;
  transition: stroke-dashoffset 1.6s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.5s ease;
}

/* Wordmark: hidden by default, fades in last */
.logo-overlay text {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 0.32em;
  text-transform: lowercase;
  opacity: 0;
  transition: opacity 1.0s ease 1.4s; /* appears after the rings settle */
}

/* Reveal state:
   - Boulder disc fades in first (locks in the filled circle of the logo)
   - Head ring draws in shortly after (completes the open ring)
   - Wordmark fades in last */
.logo-overlay.is-revealed #boulderDisc {
  opacity: 1;
}
.logo-overlay.is-revealed #headRing {
  opacity: 1;
  stroke-dashoffset: 0;
  transition-delay: 0.4s, 0.4s; /* slight delay so disc settles first */
}
.logo-overlay.is-revealed text {
  opacity: 0.85;
}


/* ============================
   Content / text panels
   ============================ */

.content {
  position: relative;
  z-index: 2;
}

.panel {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 80px;
}

/* Text content sits in the LEFT column, Sisyphus lives on the right
   (rendered in the canvas behind). Form panels can be a little wider. */
.panel-content {
  max-width: 38vw;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  /* Subtle text-shadow keeps text legible if it ever overlaps the bright gold */
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.7);
}

/* Intro panel: centered word, no left-anchored column */
.panel-intro {
  max-width: none;
  width: 100%;
  align-items: center;
  text-align: center;
}

/* Form panel needs a touch more width */
.form-panel .panel-content {
  max-width: 36vw;
  min-width: 380px;
}

/* ============================
   Typography
   ============================ */

.intro-word {
  font-family: var(--serif);
  font-size: var(--intro-size);
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--off-white);
}

.hero-heading {
  font-size: var(--hero-size);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.hero-subhead {
  font-size: clamp(19px, 1.6vw, 26px);
  font-weight: 400;
  line-height: 1.35;
  opacity: 0.85;
}

.quote-attribution {
  font-size: clamp(13px, 0.9vw, 15px) !important;
  font-weight: 500 !important;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-top: 18px !important;
  line-height: 1 !important;
}

.panel-content p {
  font-size: var(--body-size);
  line-height: 1.55;
  font-weight: 400;
}

.receipts-final {
  font-size: var(--reveal-size) !important;
  font-weight: 500 !important;
  margin-top: 14px !important;
  line-height: 1.1 !important;
}

.agencity-heading {
  font-size: var(--reveal-size);
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: 6px;
}

/* ============================
   Form
   ============================ */

.form-opener {
  font-size: var(--reveal-size) !important;
  font-weight: 500 !important;
  margin-bottom: 28px;
  line-height: 1.2;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  max-width: 480px;
}

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

.field label {
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.55;
}

.field input,
.field select {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(245, 244, 240, 0.3);
  color: var(--off-white);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  padding: 8px 0;
  outline: none;
  transition: border-color 0.3s ease;
}

.field input:focus,
.field select:focus {
  border-bottom-color: var(--off-white);
}

.field select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f5f4f0' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  padding-right: 28px;
}

.field select option {
  background: var(--black);
  color: var(--off-white);
}

.reach-out-btn {
  background: var(--off-white);
  color: var(--black);
  border: none;
  padding: 16px 36px;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  align-self: flex-start;
  margin-top: 18px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.reach-out-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ============================
   Responsive
   ============================ */

@media (max-width: 1024px) {
  .panel { padding: 80px 48px; }
  .panel-content { max-width: 44vw; }
}

@media (max-width: 768px) {
  .panel { padding: 80px 24px; }
  .panel-content {
    max-width: 100%;
    min-width: 0;
  }
  .form-panel .panel-content {
    max-width: 100%;
    min-width: 0;
  }
  .site-header { top: 20px; left: 24px; }
}
