/* ============================================================
   Social Place — fixed full-screen deck over a pen that
   splits into ink as you move through the sections
   ============================================================ */

:root {
  --paper: #fafaf8;
  --ink: #131311;
  --graphite: #56534e;
  --hairline: #e3e1db;
  --chrome: #8e9299;
  --ink-blue: #23306b; /* what a pen actually signs with */

  --font-display: "Inter Tight", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;

  --gutter: clamp(1.25rem, 4vw, 4.5rem);
}

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

html, body {
  height: 100%;
  overflow: hidden; /* the page never scrolls — the deck moves instead */
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* ---------- fixed video layer ---------- */

.video-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--paper);
}

.video-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* portrait screens: never crop the pen — the video's white
   background blends into the paper, so contain is seamless */
@media (max-aspect-ratio: 4/5) {
  .video-layer video { object-fit: contain; }
}

/* ---------- shared type ---------- */

.eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--graphite);
  margin-bottom: 1.25rem;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

em.ink {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
}

/* hand-drawn signature stroke under a key word */
.sig-wrap { position: relative; display: inline-block; }

.sig-stroke {
  position: absolute;
  left: -2%;
  bottom: -0.18em;
  width: 104%;
  height: 0.28em;
  overflow: visible;
}

.sig-stroke path {
  fill: none;
  stroke: var(--ink-blue);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 240;
  stroke-dashoffset: 240;
}

.slide.is-active .sig-stroke path {
  animation: sign 0.9s cubic-bezier(0.65, 0, 0.35, 1) 0.9s forwards;
}

@keyframes sign { to { stroke-dashoffset: 0; } }

/* ---------- nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1rem var(--gutter);
}

.nav-logo img { display: block; height: 52px; width: auto; }

.nav-links { display: flex; gap: 1.75rem; margin-left: auto; }

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--graphite);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover, .nav-links a.is-current { color: var(--ink); }

.nav-cta {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--paper);
  background: var(--ink);
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  transition: background-color 0.2s ease;
}

.nav-cta:hover { background: var(--ink-blue); }

/* ---------- deck ---------- */

.deck {
  position: fixed;
  inset: 0;
  z-index: 10;
}

.slide {
  position: absolute;
  inset: 0;
  visibility: hidden;
  pointer-events: none;
}

.slide.is-active {
  visibility: visible;
  pointer-events: auto;
}

/* content hugs the top and bottom of the screen so the pen —
   always in the middle band of the video — stays visible */
.slide-inner {
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(5.5rem, 12vh, 7.5rem) var(--gutter) clamp(3.5rem, 9vh, 5.5rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.slide-top-center, .slide-bottom-center { text-align: center; }
.slide-bottom-center { align-self: center; }

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

.hero-title { font-size: clamp(2.75rem, 7.5vw, 6rem); }

.hero-title-b { text-align: right; }

.hero-sub {
  max-width: 34em;
  margin-left: auto;
  text-align: right;
  margin-top: 1.25rem;
  color: var(--graphite);
}

/* ---------- shared slide title ---------- */

.slide-title { font-size: clamp(2.25rem, 5.5vw, 4.25rem); }

/* ---------- services ---------- */

.service-row {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
}
.service-row-six {
  grid-template-columns: repeat(3, 1fr);
  row-gap: clamp(1rem, 2vw, 1.75rem);
}

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

.service h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }

.service p { color: var(--graphite); font-size: 0.875rem; line-height: 1.55; }

/* ---------- work ---------- */

.project-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
}

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

.project-shot {
  display: block;
  width: min(200px, 60%);
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: #101010;
  margin-bottom: 1.1rem;
  box-shadow: 0 18px 32px -18px rgba(19, 19, 17, 0.35);
  animation: floaty 5.5s ease-in-out infinite;
}

/* each preview drifts on its own rhythm */
.project:nth-of-type(2) .project-shot { animation-duration: 6.5s; animation-delay: -2.1s; }
.project:nth-of-type(3) .project-shot { animation-duration: 7.5s; animation-delay: -4.2s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-9px) rotate(-0.6deg); }
}

.project-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.project-shot:hover img { transform: scale(1.05); }

.project-shot-contain img {
  object-fit: contain;
  padding: 8%;
}

.project-kind {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite);
  margin-bottom: 0.5rem;
}

.project h3 { font-size: 1.5rem; margin-bottom: 0.6rem; }

.project p { color: var(--graphite); font-size: 0.875rem; line-height: 1.55; }

.project-link {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.project-link:hover { color: var(--ink-blue); border-color: var(--ink-blue); }

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

.phase-row {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
}

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

.phase-num {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-blue);
}

.phase h3 { font-size: 1.15rem; margin: 0.4rem 0 0.6rem; }

.phase p { color: var(--graphite); font-size: 0.875rem; line-height: 1.55; }

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

.contact-sub {
  color: var(--graphite);
  max-width: 34em;
  margin: 0 auto 2rem;
}

.contact-btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 500;
  color: var(--paper);
  background: var(--ink);
  text-decoration: none;
  padding: 1rem 2.4rem;
  border-radius: 999px;
  transition: background-color 0.25s ease, transform 0.25s ease;
}

.contact-btn:hover { background: var(--ink-blue); transform: translateY(-2px); }

.footer-line {
  margin-top: 2.25rem;
  font-size: 0.75rem;
  color: var(--graphite);
}

/* ---------- deck chrome ---------- */

.deck-ui {
  position: fixed;
  left: var(--gutter);
  bottom: 1.75rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--graphite);
}

.deck-count { font-variant-numeric: tabular-nums; }

.deck-hint { display: flex; align-items: center; gap: 0.7rem; }

.deck-hint-line {
  display: block;
  width: 3.5rem;
  height: 1px;
  background: var(--graphite);
  transform-origin: left;
  animation: cue 2.4s ease-in-out infinite;
}

@keyframes cue {
  0%, 100% { transform: scaleX(0.35); opacity: 0.4; }
  50% { transform: scaleX(1); opacity: 1; }
}

.deck-dots {
  position: fixed;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.deck-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid var(--graphite);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.25s ease, transform 0.25s ease;
}

.deck-dots button:hover { transform: scale(1.35); }

.deck-dots button.is-active {
  background: var(--ink);
  border-color: var(--ink);
}

/* ---------- accessibility ---------- */

:focus-visible {
  outline: 2px solid var(--ink-blue);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .deck-hint-line { animation: none; }
  .slide.is-active .sig-stroke path { animation: none; stroke-dashoffset: 0; }
  .project-shot { animation: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .service-row, .phase-row { grid-template-columns: repeat(2, 1fr); }

  /* work turns into a swipeable carousel */
  .project-row {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0.5rem var(--gutter) 1rem;
    scrollbar-width: none;
  }
  .project-row::-webkit-scrollbar { display: none; }

  /* mini horizontal cards along the bottom — the pen keeps the stage */
  .project {
    flex: 0 0 72%;
    max-width: 300px;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border: 1px solid var(--hairline);
    border-top: 2px solid var(--ink);
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    background: rgba(250, 250, 248, 0.82);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }

  .project-shot {
    width: 92px;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    margin-bottom: 0;
    animation: none;   /* cards move with your thumb — no extra drift */
  }

  .project-shot-contain img { padding: 6%; }

  .project p { display: none; }

  .project h3 { font-size: 1rem; margin-bottom: 0.1rem; }

  .project-kind { font-size: 0.6rem; margin-bottom: 0.2rem; }

  .project-link { margin-top: 0.25rem; font-size: 0.75rem; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-logo img { height: 44px; }
  .slide-inner { padding-top: 5rem; padding-bottom: 4.5rem; }
  .hero-title-b, .hero-sub { text-align: left; margin-left: 0; }
  .service p, .phase p { display: none; }
  .service, .phase { padding-top: 0.8rem; }
  .deck-dots { display: none; }
  .deck-hint { display: none; }
}

@media (max-height: 680px) and (min-width: 901px) {
  .project-shot { display: none; }
}

@media (max-height: 620px) {
  .service p, .phase p { display: none; }
  .eyebrow { margin-bottom: 0.6rem; }
}
