/* =========================================================
   Harbor — starter stylesheet
   Everything is driven by the tokens in :root. Change those
   first; the rest of the file follows.
   ========================================================= */

/* Self-hosted display serif (SIL Open Font License — see /fonts/OFL.txt).
   Kept small and local so the page has no third-party requests. */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-latin-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-latin-italic.woff2") format("woff2");
}

:root {
  --paper: #f7f4ee;
  --surface: #fffdf8;
  --ink: #16150f;
  --muted: #6b6459;
  --line: rgba(22, 21, 15, 0.14);
  --accent: #bb4a22;
  --tint: #efe9de;
  --nav-bg: rgba(247, 244, 238, 0.78);
  --shadow: 0 24px 50px -28px rgba(30, 24, 16, 0.45);

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;

  --shell: 1120px;
  --gutter: clamp(20px, 5vw, 48px);
  --radius: 18px;
}

:root[data-theme="dark"] {
  --paper: #100f0d;
  --surface: #191712;
  --ink: #f3efe6;
  --muted: #9c9486;
  --line: rgba(243, 239, 230, 0.15);
  --accent: #e8784d;
  --tint: #15130f;
  --nav-bg: rgba(16, 15, 13, 0.72);
  --shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.85);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -100px;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 0 0 10px 10px;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- type ---------- */
h1, h2, .contact__mail, .tile__mark, .tile__glyph {
  font-family: var(--serif);
  font-weight: 400;
}

h1 {
  font-size: clamp(2.9rem, 6.4vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

h1 em,
h2 em {
  font-style: italic;
  color: var(--accent);
}

h2 {
  font-size: clamp(2.05rem, 4.4vw, 3.35rem);
  line-height: 1.02;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

.lede {
  margin-top: 26px;
  max-width: 46ch;
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  color: var(--muted);
  line-height: 1.65;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}
.btn:hover { transform: translateY(-2px); background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:active { transform: translateY(0); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
  transform: translateY(-2px);
}

.btn--sm { padding: 10px 18px; font-size: 0.86rem; }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand__mark { width: 26px; height: 26px; color: var(--accent); }
.brand__name { font-size: 1.02rem; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 0.92rem;
  color: var(--muted);
}
.nav__links a { position: relative; padding: 4px 0; transition: color 0.2s ease; }
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

.nav__actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.icon-btn:hover { background: var(--tint); border-color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }

.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.nav__burger { display: none; }
.burger {
  position: relative;
  display: block;
  width: 15px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s ease, background 0.2s ease;
}
.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 15px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s ease, opacity 0.2s ease;
}
.burger::before { top: -5px; }
.burger::after { top: 5px; }

.nav__burger[aria-expanded="true"] .burger { background: transparent; }
.nav__burger[aria-expanded="true"] .burger::before { transform: translateY(5px) rotate(45deg); }
.nav__burger[aria-expanded="true"] .burger::after { transform: translateY(-5px) rotate(-45deg); }

.mobile-menu {
  border-top: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.mobile-menu nav {
  display: flex;
  flex-direction: column;
  padding: 8px var(--gutter) 22px;
}
.mobile-menu a {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 1.5rem;
}
.mobile-menu a:last-child { border-bottom: 0; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding-top: clamp(120px, 17vh, 180px);
  padding-bottom: clamp(56px, 9vh, 96px);
}
.hero::before {
  content: "";
  position: absolute;
  inset: -10% -20% auto auto;
  width: 70vw;
  height: 70vw;
  max-width: 900px;
  max-height: 900px;
  background: radial-gradient(circle at 55% 45%, rgba(187, 74, 34, 0.13), transparent 62%);
  pointer-events: none;
  z-index: -1;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--surface);
  margin-bottom: 26px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3e9b62;
  box-shadow: 0 0 0 0 rgba(62, 155, 98, 0.55);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(62, 155, 98, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(62, 155, 98, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 155, 98, 0); }
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 44px;
  margin-top: 54px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.facts dt {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}
.facts dd { font-size: 0.95rem; }

/* collage */
.hero__art { position: relative; }
.collage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.02;
}

.tile {
  position: absolute;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.16);
  animation: float 9s ease-in-out infinite alternate;
}
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='.55'/></svg>");
  opacity: 0.14;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.tile--a {
  width: 58%;
  height: 60%;
  left: 0;
  top: 7%;
  transform: rotate(-6deg);
  background: linear-gradient(145deg, #f2b9a0 0%, #d0623a 52%, #7d2f18 100%);
  animation-delay: -1s;
}
.tile--b {
  width: 50%;
  height: 44%;
  right: 0;
  top: 0;
  transform: rotate(5deg);
  background: linear-gradient(160deg, #d3dcc9 0%, #8ba583 50%, #3f5c48 100%);
  animation-delay: -4s;
}
.tile--c {
  width: 62%;
  height: 39%;
  right: 3%;
  bottom: 1%;
  transform: rotate(-3deg);
  background: linear-gradient(120deg, #f1e9da 0%, #dccfb7 55%, #c3b295 100%);
  border-color: rgba(0, 0, 0, 0.08);
  animation-delay: -6s;
}

@keyframes float {
  from { translate: 0 0; }
  to { translate: 0 -12px; }
}

.tile__tag {
  position: absolute;
  top: 13px;
  left: 13px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.tile--c .tile__tag { background: rgba(0, 0, 0, 0.08); color: #3b352b; }

.tile__mark {
  position: absolute;
  left: 16px;
  bottom: -10px;
  font-size: 6.4rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.9);
}
.tile__glyph {
  position: absolute;
  right: 14px;
  bottom: -18px;
  font-size: 7.4rem;
  line-height: 1;
  color: rgba(60, 52, 38, 0.72);
}
.tile__bars {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 46px;
}
.tile__bars i {
  display: block;
  width: 7px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.82);
}
.tile__bars i:nth-child(1) { height: 18px; }
.tile__bars i:nth-child(2) { height: 34px; }
.tile__bars i:nth-child(3) { height: 24px; }
.tile__bars i:nth-child(4) { height: 44px; }

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding: 15px 0;
  margin-top: clamp(24px, 6vh, 40px);
}
.marquee__track {
  display: flex;
  align-items: center;
  gap: 34px;
  width: max-content;
  animation: slide 38s linear infinite;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.marquee__track span[aria-hidden] {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  font-size: 0;
  line-height: 0;
  flex: none;
}
@keyframes slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- sections ---------- */
.section { padding: clamp(76px, 12vh, 132px) 0; }
.section--tint {
  background: var(--tint);
  border-block: 1px solid var(--line);
}

.section__head { max-width: 760px; margin-bottom: clamp(38px, 6vh, 64px); }
.section__note {
  margin-top: 22px;
  max-width: 42ch;
  color: var(--muted);
  font-size: 0.96rem;
}

/* ---------- work ---------- */
.work {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--ink) 28%, transparent);
}

.card__link { display: block; height: 100%; }

.card__cover {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
}
.card__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='.55'/></svg>");
  opacity: 0.13;
  mix-blend-mode: overlay;
}
.cover--a { background: linear-gradient(150deg, #f0b49b 0%, #cf5c34 55%, #6f2914 100%); }
.cover--b { background: linear-gradient(165deg, #cfdcc8 0%, #7e9b7a 48%, #2f4a38 100%); }
.cover--c { background: linear-gradient(135deg, #e8dcc4 0%, #c0ab8a 55%, #8a7458 100%); }

.card__cover::before {
  content: "";
  position: absolute;
  right: -18%;
  bottom: -32%;
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.55), transparent 62%);
}
.cover--c::before { background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.75), transparent 65%); }

.card__index {
  position: absolute;
  top: 15px;
  left: 17px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.8);
}
.cover--c .card__index { color: rgba(40, 34, 24, 0.65); }

.card__arrow {
  position: absolute;
  top: 12px;
  right: 13px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.95rem;
  transition: transform 0.35s ease, background 0.35s ease;
}
.cover--c .card__arrow { background: rgba(0, 0, 0, 0.08); color: #3b352b; }
.card:hover .card__arrow { transform: translate(2px, -2px); background: rgba(255, 255, 255, 0.34); }

.card__body { padding: 22px 22px 24px; }
.card__body h3 { font-size: 1.22rem; letter-spacing: -0.012em; }
.card__body p {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tags li {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 4px 9px;
  border-radius: 999px;
}

/* ---------- services ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 52px);
}
.service { border-top: 1px solid var(--line); padding-top: 24px; }
.service__num {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.service h3 { margin: 14px 0 10px; font-size: 1.32rem; letter-spacing: -0.01em; }
.service p { color: var(--muted); font-size: 0.95rem; max-width: 34ch; }

/* ---------- about ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}

.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(165deg, #e9dfcc 0%, #cec1a6 45%, #8d7f66 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='.55'/></svg>");
  opacity: 0.16;
  mix-blend-mode: overlay;
}
.portrait__label {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(48, 41, 30, 0.7);
}

.about h2 { margin-bottom: 24px; }
.about__copy p { color: var(--muted); max-width: 52ch; margin-bottom: 16px; }

.about__list { margin-top: 30px; border-top: 1px solid var(--line); }
.about__list li {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.93rem;
}
.about__list span {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}

/* ---------- contact ---------- */
.contact { text-align: left; }
.contact__title { margin-bottom: 24px; }
.contact__lede { max-width: 44ch; color: var(--muted); margin-bottom: 36px; }

.contact__mail {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1.15rem, 3vw, 1.9rem);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  transition: color 0.25s ease, border-color 0.25s ease;
  word-break: break-word;
}
.contact__mail:hover { color: var(--accent); border-color: var(--accent); }
.contact__mail span { font-family: var(--sans); font-size: 0.7em; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 44px 0 48px; }
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}
.footer__brand { font-weight: 600; font-size: 0.95rem; }
.footer__brand span { font-weight: 400; color: var(--muted); }
.footer__links { display: flex; flex-wrap: wrap; gap: 22px; font-size: 0.88rem; color: var(--muted); }
.footer__links a:hover { color: var(--ink); }
.footer__legal { width: 100%; font-size: 0.78rem; color: var(--muted); }

/* ---------- reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--d, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .hero__grid { grid-template-columns: 1fr; gap: 48px; }
  .hero__art { max-width: 460px; width: 100%; margin-inline: auto; }
  .work { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .services { grid-template-columns: 1fr; gap: 26px; }
  .about { grid-template-columns: 1fr; }
  .about__portrait { max-width: 340px; }
}

@media (max-width: 860px) {
  .nav__links, .nav .btn--sm { display: none; }
  .nav__burger { display: grid; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .work { grid-template-columns: 1fr; }
  .facts { gap: 16px 28px; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- 404 ---------- */
.nf {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 110px 0 170px;
  overflow: hidden;
}
.nf__inner { position: relative; z-index: 1; }
.nf__code { margin-top: 52px; margin-bottom: 18px; }
.nf h1 { margin-bottom: 22px; }
.nf__cta { margin-top: 34px; }
.nf__water {
  position: absolute;
  inset: auto 0 0 0;
  height: 42vh;
  background: linear-gradient(180deg, transparent, var(--tint));
  pointer-events: none;
}
