/* ─────────────────────────────────────────────────────────────
   Offline Works — monochrome, dark, quiet.
   Two typefaces only: Instrument Serif (voice) + JetBrains Mono (labels).
   ───────────────────────────────────────────────────────────── */

:root {
  --ink:        #0e0f11;
  --ink-2:      #131417;
  --ink-3:      #17181a;   /* the logo's own black */
  --paper:      #f5f3ef;
  --paper-dim:  #b9b6ae;
  --muted:      #7b7a75;
  --line:       rgba(245, 243, 239, .11);
  --line-soft:  rgba(245, 243, 239, .06);

  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --pad: clamp(1.25rem, 5vw, 5.5rem);
  --maxw: 1420px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* full-bleed bands, one shared measure for their contents */
:root { --gut: max(var(--pad), calc((100vw - var(--maxw)) / 2)); }

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--paper); color: var(--ink); }

a { color: inherit; text-decoration: none; }

/* ── atmosphere ──────────────────────────────────────────── */

/* film grain */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 9;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: drift 6s steps(4) infinite;
}
@keyframes drift {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-2%, 1%); }
  50%  { transform: translate(1%, -2%); }
  75%  { transform: translate(-1%, -1%); }
  100% { transform: translate(0, 0); }
}

/* drafting-paper vertical rules + top-down vignette */
.rules {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(245,243,239,.035), transparent 55%),
    repeating-linear-gradient(90deg,
      var(--line-soft) 0 1px, transparent 1px calc(100% / 6));
  background-size: 100% 100%, 100% 100%;
  mask-image: linear-gradient(180deg, #000 0%, #000 70%, transparent 100%);
}

main, .topbar, .footer { position: relative; z-index: 1; }

/* ── top bar ─────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem var(--gut);
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  backdrop-filter: blur(14px) saturate(120%);
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--ease), background .4s var(--ease);
}
.topbar.is-stuck { border-bottom-color: var(--line); }

.brand { display: flex; align-items: center; gap: .7rem; }
.brand-mark {
  width: 22px; height: 22px;
  color: var(--paper);
  transition: transform .6s var(--ease), opacity .3s;
}
.brand:hover .brand-mark { transform: rotate(-90deg); }
.brand-name {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-weight: 500;
}

.nav { display: flex; gap: clamp(1rem, 3vw, 2.25rem); }
.nav a {
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  padding-bottom: 2px;
  transition: color .3s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .4s var(--ease);
}
.nav a:hover { color: var(--paper); }
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ── hero ────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 9vh, 6rem) var(--gut) clamp(2.5rem, 6vh, 4.5rem);
  min-height: min(96vh, 1000px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.watermark {
  position: absolute;
  top: 50%;
  right: calc(var(--pad) * -0.35);
  translate: 0 -50%;
  width: clamp(320px, 46vw, 720px);
  aspect-ratio: 1;
  color: var(--paper);
  opacity: .05;
  pointer-events: none;
}
.watermark path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 3.4s var(--ease) .3s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.kicker {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 clamp(1.5rem, 4vh, 2.75rem);
}

.lamp {
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: .6rem;
  translate: 0 -1px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 0 rgba(245,243,239,.5);
  animation: pulse 2.8s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,243,239,.45); opacity: 1; }
  60%      { box-shadow: 0 0 0 7px rgba(245,243,239,0); opacity: .65; }
}

.title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.75rem, 14.5vw, 12.5rem);
  line-height: .82;
  letter-spacing: -.02em;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.line { display: block; }
.line--in {
  margin-left: clamp(1.5rem, 9vw, 8.5rem);
  display: flex;
  align-items: baseline;
  gap: .045em;
}
.line--in em { font-style: italic; }

.tick {
  width: .105em;
  height: .105em;
  background: var(--paper);
  display: inline-block;
  translate: 0 -.06em;
  animation: blink 3.2s steps(1) infinite;
}
@keyframes blink { 0%, 72% { opacity: 1; } 73%, 100% { opacity: .25; } }

.hero-foot {
  display: grid;
  grid-template-columns: minmax(0, 34rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
  margin-top: clamp(2rem, 6vh, 4rem);
  padding-left: clamp(0rem, 9vw, 8.5rem);
}

.lead {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2.1vw, 1.65rem);
  line-height: 1.45;
  color: var(--paper-dim);
  margin: 0;
  max-width: 34rem;
}
.hi {
  color: var(--paper);
  font-style: italic;
  position: relative;
  white-space: nowrap;
}
.hi::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: .06em;
  height: 1px;
  background: rgba(245,243,239,.35);
}

.meta {
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 2;
  margin: .35rem 0 0;
}

.scroll-cue {
  margin-top: clamp(1.5rem, 4vh, 3rem);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  align-self: flex-start;
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .3s;
}
.scroll-cue:hover { color: var(--paper); }
.arrow { animation: nudge 2.2s var(--ease) infinite; }
@keyframes nudge {
  0%, 100% { transform: translateY(0); opacity: .5; }
  50%      { transform: translateY(4px); opacity: 1; }
}

/* ── ticker ──────────────────────────────────────────────── */

.ticker {
  border-block: 1px solid var(--line);
  overflow: hidden;
  padding: .85rem 0;
  background: var(--ink-2);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.ticker-track span {
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--muted);
  padding-right: 1.5rem;
  white-space: nowrap;
}
@keyframes marquee { to { transform: translateX(-33.333%); } }

/* ── sections ────────────────────────────────────────────── */

.section {
  padding: clamp(4.5rem, 13vh, 9rem) var(--gut);
  border-bottom: 1px solid var(--line-soft);
}

.section-head { margin-bottom: clamp(2.25rem, 6vh, 4rem); }

.label {
  display: flex;
  align-items: center;
  gap: .8rem;
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.1rem;
}
.label .num {
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: .15rem .45rem;
  font-size: 10px;
  letter-spacing: .1em;
}

.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  line-height: .95;
  letter-spacing: -.015em;
  margin: 0;
}
.section-title em { font-style: italic; color: var(--paper-dim); }

/* ── work grid ───────────────────────────────────────────── */

.group + .group { margin-top: clamp(2.75rem, 7vh, 4.5rem); }

.group-label {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin: 0 0 1.1rem;
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--paper-dim);
}
.group-label::after {                /* hairline runs out to the margin */
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}
.group-n {
  order: -1;                         /* the count sits ahead of the word */
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: .15rem .45rem;
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--paper);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
}

.card {
  position: relative;
  background: var(--ink);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  min-height: 15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  overflow: hidden;
  transition: background .45s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 110%, rgba(245,243,239,.09), transparent 70%);
  opacity: 0;
  transition: opacity .5s var(--ease);
}
a.card:hover { background: var(--ink-3); }
a.card:hover::before { opacity: 1; }

.card > * { position: relative; }

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.card-kind { color: var(--paper-dim); }

.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 22.4%;          /* the corner Apple actually uses */
  display: block;
  box-shadow:
    0 0 0 1px rgba(245,243,239,.09),
    0 12px 26px -14px rgba(0,0,0,.9);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
a.card:hover .card-icon {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 0 0 1px rgba(245,243,239,.2),
    0 18px 34px -14px rgba(0,0,0,.95);
}

.card-tag {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: .2rem .5rem;
  white-space: nowrap;
  font-size: 9.5px;
  letter-spacing: .16em;
}

.card-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .4rem 1rem;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-name {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.05;
  margin: 0 0 .5rem;
}
.card-blurb {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
  max-width: 26rem;
}
.card-go {
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  gap: .5rem;
  transition: color .3s, gap .3s var(--ease);
}
a.card:hover .card-go { color: var(--paper); gap: .85rem; }

/* empty slots */
.card--slot {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1rem;
  background:
    repeating-linear-gradient(-45deg,
      rgba(245,243,239,.022) 0 6px, transparent 6px 12px),
    var(--ink);
}
.card--slot .slot-mark {
  width: 30px; height: 30px;
  color: var(--paper);
  opacity: .16;
}
.card--slot .slot-mark path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 3s var(--ease) infinite alternate;
  animation-delay: var(--sd, 0s);
}
.card--slot p {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.card--slot small {
  display: block;
  margin-top: .4rem;
  font-size: 10.5px;
  letter-spacing: .12em;
  color: rgba(123,122,117,.6);
  text-transform: none;
}

/* ── studio ──────────────────────────────────────────────── */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
}

.prose p {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.9vw, 1.5rem);
  line-height: 1.5;
  color: var(--paper-dim);
  margin: 0 0 1.4rem;
  max-width: 36rem;
}
.prose p:first-child::first-letter {
  float: left;
  font-size: 3.6em;
  line-height: .78;
  padding: .06em .12em 0 0;
  color: var(--paper);
}

.tenets { list-style: none; margin: 0; padding: 0; }
.tenets li {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: .5rem 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line-soft);
}
.tenets li:last-child { border-bottom: 1px solid var(--line-soft); }
.tenet-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--muted);
  line-height: 1.2;
}
.tenets h3 {
  margin: 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.tenets p {
  grid-column: 2;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
  max-width: 28rem;
}

/* ── contact ─────────────────────────────────────────────── */

.section--contact { border-bottom: none; }

.shout {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 9vw, 7rem);
  line-height: .92;
  letter-spacing: -.02em;
  margin: 0 0 clamp(2.5rem, 7vh, 4.5rem);
}
.shout em { font-style: italic; color: var(--paper-dim); }

.contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.mailto {
  position: relative;
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  letter-spacing: -.01em;
  padding-bottom: .35rem;
}
.mailto::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--paper);
  transform-origin: left;
  transition: transform .5s var(--ease);
}
.mailto:hover::after { transform: scaleX(0); transform-origin: right; }

/* ── footer ──────────────────────────────────────────────── */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.75rem var(--gut);
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer a { transition: color .3s; }
.footer a:hover { color: var(--paper); }
.footer-mid { opacity: .55; }

/* ── reveal on load / scroll ─────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise .95s var(--ease) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }

.in-view-target {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.in-view-target.in-view { opacity: 1; transform: none; }

:focus-visible {
  outline: 1px solid var(--paper);
  outline-offset: 4px;
}

/* ── responsive ──────────────────────────────────────────── */

@media (max-width: 860px) {
  .hero-foot { grid-template-columns: 1fr; padding-left: 0; }
  .split { grid-template-columns: 1fr; }
  .watermark { opacity: .035; right: -18%; }
  .line--in { margin-left: clamp(1rem, 6vw, 3rem); }
}

@media (max-width: 560px) {
  .nav { gap: 1rem; }
  .brand-name { display: none; }
  .footer-mid { display: none; }
  .rules { background-size: 100% 100%, 100% 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal, .in-view-target { opacity: 1; transform: none; }
  .watermark path { stroke-dashoffset: 0; }
}
