/* ============================================================
   Arlline — warm, quiet, editorial
   Type:  Young Serif (display) + Karla (body)
   ============================================================ */

:root {
  --bg: #f7f3ec;
  --bg-deep: #efe9de;
  --ink: #1d1915;
  --ink-soft: #5c554c;
  --line: rgba(29, 25, 21, 0.14);
  --accent: #c97a58;
  --serif: "Young Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Karla", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
  --morph-len: 1; /* multiplier for hero scroll length */
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

a { color: inherit; }

/* ---------- grain overlay ---------- */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 60;
  opacity: 0.05;
  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='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body[data-grain="off"] .grain { display: none; }

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
}
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--bg) 30%, transparent);
  pointer-events: none;
}
.nav > * { position: relative; }

.brand {
  font-family: var(--serif);
  font-size: 20px;
  text-decoration: none;
  display: inline-grid;
}
.brand span {
  grid-area: 1 / 1;
  transition: opacity 0.45s ease;
}
.brand .brand-ai { opacity: 0; }
.tilt {
  display: inline-block;
  transform: skewX(10deg);
  transform-origin: 50% 82%;
  color: var(--accent);
}
body.morphed .brand .brand-full { opacity: 0; }
body.morphed .brand .brand-ai { opacity: 1; }

.nav-links {
  display: flex;
  gap: 32px;
  font-size: 13.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.25s ease;
}
.nav-links a:hover { color: var(--accent); }

@media (max-width: 720px) {
  .nav { padding: 18px 22px; }
  .nav-links { display: none; }
}

/* ---------- hero / morph ---------- */
.hero-track {
  height: calc(100vh + 190vh * var(--morph-len));
  position: relative;
}
.hero {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* soft warm wash behind the wordmark */
.hero::before {
  content: "";
  position: absolute;
  width: 90vmin; height: 90vmin;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 122, 88, 0.13), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
}

.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(72px, 17vw, 230px);
  line-height: 1;
  white-space: nowrap;
  display: flex;
  align-items: baseline;
  position: relative;
}
.lt {
  display: inline-block;
  overflow: visible;
  will-change: transform, opacity, filter;
}
.lt.fade-out { transform-origin: 0 50%; /* compress toward left edge */ }

.mark-i {
  transform: skewX(10deg);
  transform-origin: 50% 82%;
  color: var(--accent);
  will-change: transform;
}

.hero-caption {
  margin-top: 36px;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateY(10px);
  will-change: opacity, transform;
}

.scroll-hint {
  position: absolute;
  bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  will-change: opacity;
}
.scroll-hint::after {
  content: "";
  width: 1px;
  height: 44px;
  background: var(--ink-soft);
  animation: hint-drop 2.2s ease-in-out infinite;
  transform-origin: top;
}
@keyframes hint-drop {
  0% { transform: scaleY(0); }
  45% { transform: scaleY(1); }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- shared section chrome ---------- */
section.page {
  position: relative;
  padding: 130px 40px;
}
section.page .inner {
  max-width: var(--maxw);
  margin: 0 auto;
}
@media (max-width: 720px) {
  section.page { padding: 90px 22px; }
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 40px;
}

h2.statement {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.6vw, 58px);
  line-height: 1.18;
  margin: 0;
  max-width: 18em;
  text-wrap: pretty;
}

.lede {
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 36em;
  text-wrap: pretty;
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 70px;
  align-items: start;
  margin-top: 56px;
}
@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
}
.about-grid p { margin: 0 0 22px; }

/* ---------- framework ---------- */
#framework { background: var(--bg-deep); }

.cc-list {
  margin-top: 70px;
  border-top: 1px solid var(--line);
}
.cc-row {
  display: grid;
  grid-template-columns: 90px 1fr 1.4fr;
  gap: 40px;
  align-items: baseline;
  padding: 44px 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.35s ease;
}
.cc-row:hover { padding-left: 14px; }
.cc-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
}
.cc-name {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 38px);
  margin: 0;
  font-weight: 400;
}
.cc-desc {
  margin: 0;
  color: var(--ink-soft);
  max-width: 34em;
  text-wrap: pretty;
}
@media (max-width: 880px) {
  .cc-row { grid-template-columns: 60px 1fr; }
  .cc-desc { grid-column: 2; }
}

/* ---------- services ---------- */
.svc-list {
  margin-top: 70px;
  display: grid;
  gap: 56px;
}
.svc {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 40px;
  align-items: baseline;
}
.svc:nth-child(2) { margin-left: 8%; }
.svc h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 2.6vw, 32px);
  margin: 0;
}
.svc p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 32em;
  text-wrap: pretty;
}
@media (max-width: 880px) {
  .svc { grid-template-columns: 1fr; gap: 10px; }
  .svc:nth-child(2) { margin-left: 0; }
}

/* ---------- work ---------- */
.work-grid {
  margin-top: 70px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
@media (max-width: 880px) {
  .work-grid { grid-template-columns: 1fr; }
}
.work-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  cursor: pointer;
}
.work-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.work-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -28px rgba(29, 25, 21, 0.35);
}
.work-ph {
  aspect-ratio: 16 / 10;
  background: repeating-linear-gradient(
    -45deg,
    var(--bg-deep) 0 14px,
    var(--bg) 14px 28px
  );
  display: flex;
  align-items: center;
  justify-content: center;
}
.work-ph span {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 6px 12px;
}
.work-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-top: 1px solid var(--line);
}
.work-meta h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 20px;
  margin: 0;
}
.work-meta span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
.work-card .reveal-note {
  position: absolute;
  inset: auto 0 0 0;
  padding: 20px 22px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  transform: translateY(100%);
  transition: transform 0.35s ease;
}
.work-card:hover .reveal-note { transform: translateY(0); }

/* ---------- case study overlay ---------- */
.cs-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.cs-overlay[hidden] { display: none; }
.cs-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(29, 25, 21, 0.55);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.cs-overlay.open::before { opacity: 1; }
.cs-sheet {
  position: relative;
  background: var(--bg);
  width: min(860px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 6px;
  box-shadow: 0 40px 90px -30px rgba(29, 25, 21, 0.5);
  transform-origin: top left;
  transition: transform 0.55s cubic-bezier(0.2, 0.75, 0.2, 1);
}
.cs-close {
  position: sticky;
  top: 18px;
  float: right;
  margin: 18px 22px 0 0;
  z-index: 2;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 99px;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.cs-close:hover { color: var(--accent); border-color: var(--accent); }
.cs-inner {
  padding: 64px 72px 72px;
  opacity: 0;
  transition: opacity 0.45s ease 0.25s;
}
.cs-overlay.open .cs-inner { opacity: 1; }
@media (max-width: 720px) {
  .cs-overlay { padding: 12px; }
  .cs-inner { padding: 48px 26px 52px; }
}
.cs-inner .eyebrow { margin-bottom: 18px; }
.cs-inner h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4vw, 44px);
  margin: 0 0 32px;
  line-height: 1.15;
}
.cs-hero {
  aspect-ratio: 16 / 8;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: repeating-linear-gradient(
    -45deg,
    var(--bg-deep) 0 14px,
    var(--bg) 14px 28px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 44px;
}
.cs-hero span {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 6px 12px;
}
.cs-inner h4 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 400;
  margin: 36px 0 10px;
}
.cs-inner p { margin: 0 0 14px; color: var(--ink-soft); max-width: 38em; }
.ph-line {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  opacity: 0.75;
}

@media (prefers-reduced-motion: reduce) {
  .cs-sheet { transition: none; }
  .cs-inner { transition: none; opacity: 1; }
}

/* ---------- contact ---------- */
#contact { background: var(--ink); color: var(--bg); }
#contact .eyebrow { color: var(--accent); }
#contact .lede { color: rgba(247, 243, 236, 0.7); }
#contact .inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 36px;
  padding: 60px 0;
}
.contact-cta {
  font-family: var(--serif);
  font-size: clamp(22px, 2.8vw, 34px);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  transition: gap 0.3s ease, color 0.3s ease;
}
.contact-cta:hover { gap: 30px; color: var(--accent); }
.contact-cta .arrow { font-family: var(--sans); }

/* ---------- footer ---------- */
footer {
  background: var(--ink);
  color: rgba(247, 243, 236, 0.45);
  padding: 28px 40px 44px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
@media (max-width: 720px) {
  footer { flex-direction: column; padding: 24px 22px 36px; }
}

/* ---------- scroll reveals ---------- */
@media (prefers-reduced-motion: no-preference) {
  .rv {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s ease, transform 0.8s ease;
  }
  .rv.in { opacity: 1; transform: none; }
  .rv:nth-child(2) { transition-delay: 0.08s; }
  .rv:nth-child(3) { transition-delay: 0.16s; }
  .rv:nth-child(4) { transition-delay: 0.24s; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-track { height: auto; }
  .hero { position: static; height: 100vh; }
  .hero-caption { opacity: 1; transform: none; }
}
