/* ============================================================
   Portfolio Landing — styles
   Self-contained: system fonts only, no external assets.
   ============================================================ */

:root {
  --paper: #f5f2eb;
  --paper-2: #eeeae1;
  --ink: #16130e;
  --ink-soft: #3b352c;
  --muted: #6e675c;
  --line: rgba(22, 19, 14, 0.14);
  --line-soft: rgba(22, 19, 14, 0.08);
  --accent: #b4471f;
  --accent-soft: rgba(180, 71, 31, 0.1);

  /* Basic, universally available stacks — no downloaded or niche fonts */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", Times, serif;
  --mono: ui-monospace, Menlo, Consolas, "Courier New", monospace;

  --gutter: 24px;
  --maxw: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
  overflow-x: clip;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
ul, ol { margin: 0; list-style: none; padding: 0; }

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

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  font-size: 14px;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Shared type ---------- */

.eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  flex: none;
}
.eyebrow-light { color: rgba(245, 242, 235, 0.55); }

/* Placeholder slots — visible so nothing invented ships by accident */
.slot {
  color: var(--muted);
  font-style: italic;
  text-decoration: underline dashed;
  text-decoration-color: rgba(22, 19, 14, 0.28);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.contact .slot {
  color: rgba(245, 242, 235, 0.55);
  text-decoration-color: rgba(245, 242, 235, 0.3);
}
.btn .slot {
  color: rgba(22, 19, 14, 0.62);
  text-decoration-color: rgba(22, 19, 14, 0.3);
}
.socials .slot { text-decoration: none; }

.display {
  font-family: var(--serif);
  font-size: clamp(2.45rem, 5.4vw, 4.45rem);
  line-height: 1.06;
  letter-spacing: -0.023em;
}
.display em {
  font-style: italic;
  color: var(--accent);
}

.h2 {
  font-family: var(--serif);
  font-size: clamp(1.85rem, 3.6vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.019em;
  text-wrap: balance;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 4px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.28s var(--ease), background-color 0.28s var(--ease),
              color 0.28s var(--ease), border-color 0.28s var(--ease),
              box-shadow 0.28s var(--ease);
  will-change: transform;
}
.btn .icon {
  width: 15px;
  height: 15px;
  transition: transform 0.32s var(--ease);
}
.btn:hover .icon { transform: translateX(3px); }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 1px 0 rgba(22, 19, 14, 0.2);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -12px rgba(22, 19, 14, 0.55);
}

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

.btn-invert {
  background: var(--paper);
  color: var(--ink);
}
.btn-invert:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.7);
}

.btn-sm { padding: 9px 17px; font-size: 13.5px; }
.btn-outline {
  border-color: var(--line);
  color: var(--ink);
}
.btn-outline:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: rgba(245, 242, 235, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s var(--ease), background-color 0.35s var(--ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line-soft);
  background: rgba(245, 242, 235, 0.9);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 16px;
  display: grid;
  place-items: center;
  line-height: 1;
  padding-bottom: 2px;
}
.brand-text { font-size: 15.5px; }
.brand-mark svg { width: 15px; height: 15px; display: block; }

.nav {
  display: flex;
  gap: 30px;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.nav a {
  position: relative;
  padding: 4px 0;
  transition: color 0.25s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 168px 0 108px;
  background:
    radial-gradient(900px 480px at 78% -10%, rgba(180, 71, 31, 0.07), transparent 62%),
    radial-gradient(700px 420px at 5% 8%, rgba(22, 19, 14, 0.045), transparent 60%);
}

.hero-inner { max-width: 1040px; }

@media (max-width: 760px) {
  .display br { display: none; }
}

.lede {
  margin-top: 30px;
  max-width: 560px;
  font-size: 18px;
  line-height: 1.68;
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 46px;
  font-size: 13.5px;
  color: var(--muted);
}
.status { display: inline-flex; align-items: center; gap: 9px; }
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f7d4f;
  box-shadow: 0 0 0 0 rgba(47, 125, 79, 0.45);
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 125, 79, 0.4); }
  70% { box-shadow: 0 0 0 7px rgba(47, 125, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 125, 79, 0); }
}
.sep {
  width: 1px;
  height: 12px;
  background: var(--line);
}

.hero-rail {
  position: absolute;
  right: max(18px, calc((100% - var(--maxw)) / 2 - 26px));
  top: 210px;
  writing-mode: vertical-rl;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.28em;
  color: var(--muted);
  opacity: 0.7;
}

/* ---------- Stack band ---------- */

.stack-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}
.stack-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stack-list li {
  padding: 22px 24px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.stack-list li + li {
  border-left: 1px solid var(--line-soft);
  padding-left: 24px;
}
.stack-key {
  font-size: 10.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
}
.stack-val {
  font-family: var(--serif);
  font-size: 15.5px;
  letter-spacing: -0.005em;
  overflow-wrap: break-word;
}

/* ---------- Sections ---------- */

.section { padding: 112px 0; }
.section-alt {
  background: var(--paper-2);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.section-head { max-width: 720px; margin-bottom: 62px; }

/* ---------- Work list ---------- */

.work-list { border-top: 1px solid var(--line); }

.work-item { border-bottom: 1px solid var(--line); }

.work-link {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 168px 34px;
  align-items: start;
  gap: 20px;
  padding: 34px 8px 34px 0;
  position: relative;
  transition: padding 0.4s var(--ease), background-color 0.4s var(--ease);
}
.work-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent-soft), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.work-link:hover { padding-left: 18px; }
.work-link:hover::before { opacity: 1; }

.work-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding-top: 7px;
  letter-spacing: 0.04em;
}

.work-body { display: flex; flex-direction: column; gap: 10px; }
.work-title {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.3vw, 1.75rem);
  line-height: 1.2;
  letter-spacing: -0.016em;
  transition: color 0.3s var(--ease);
}
.work-link:hover .work-title { color: var(--accent); }
.work-desc {
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--ink-soft);
  max-width: 58ch;
}
.work-tags {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.work-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  text-align: right;
  padding-top: 6px;
}
.work-year { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }

.work-arrow {
  align-self: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: transform 0.4s var(--ease), background-color 0.4s var(--ease),
              color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.work-arrow svg { width: 15px; height: 15px; }
.work-link:hover .work-arrow {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  transform: translate(3px, -3px);
}

/* ---------- Principles ---------- */

.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.principle {
  padding: 34px 34px 8px 0;
}
.principle + .principle {
  border-left: 1px solid var(--line-soft);
  padding-left: 34px;
}
.principle-num {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 20px;
}
.principle h3 {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: -0.012em;
  margin-bottom: 12px;
  line-height: 1.3;
}
.principle p {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 34ch;
}
.principle code,
.work-desc code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(22, 19, 14, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 72px;
  align-items: start;
}
.about-left .h2 { position: sticky; top: 110px; }

.about-lede {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}
.about-right p {
  color: var(--ink-soft);
  max-width: 62ch;
}
.about-right > p + p { margin-top: 18px; }

.facts {
  margin: 40px 0 0;
  border-top: 1px solid var(--line);
}
.fact {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 20px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
}
.fact dt {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 4px;
}
.fact dd { margin: 0; color: var(--ink-soft); }

/* ---------- Contact ---------- */

.contact {
  background: var(--ink);
  color: var(--paper);
  padding: 118px 0 0;
  position: relative;
  overflow: hidden;
}
.contact::after {
  content: "";
  position: absolute;
  width: 620px;
  height: 620px;
  right: -220px;
  top: -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 71, 31, 0.28), transparent 68%);
  pointer-events: none;
}

.contact-display {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5.6vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.022em;
  text-wrap: balance;
}
.contact-display em {
  font-style: italic;
  color: #e08a63;
}

.contact-lede {
  margin-top: 28px;
  max-width: 520px;
  font-size: 17px;
  color: rgba(245, 242, 235, 0.72);
}

.contact-actions { margin-top: 42px; }

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 30px;
  margin-top: 54px;
  font-size: 14px;
}
.socials a {
  color: rgba(245, 242, 235, 0.66);
  border-bottom: 1px solid rgba(245, 242, 235, 0.22);
  padding-bottom: 2px;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.socials a:hover {
  color: var(--paper);
  border-color: var(--paper);
}

.site-footer {
  margin-top: 84px;
  border-top: 1px solid rgba(245, 242, 235, 0.14);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 26px;
  padding-bottom: 30px;
  font-size: 12.5px;
  color: rgba(245, 242, 235, 0.45);
}
.footer-inner a {
  color: rgba(245, 242, 235, 0.62);
  border-bottom: 1px solid rgba(245, 242, 235, 0.2);
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.footer-inner a:hover {
  color: var(--paper);
  border-color: var(--paper);
}

/* ---------- Reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero { padding: 142px 0 88px; }
  .hero-rail { display: none; }
  .stack-list { grid-template-columns: repeat(2, 1fr); }
  .stack-list li:nth-child(3) {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--line-soft);
  }
  .stack-list li:nth-child(4) {
    border-top: 1px solid var(--line-soft);
  }
  .work-link {
    grid-template-columns: 40px minmax(0, 1fr) 30px;
    gap: 16px;
  }
  .work-arrow { width: 30px; height: 30px; }
  .work-arrow svg { width: 13px; height: 13px; }
  .work-meta {
    grid-column: 2 / 3;
    flex-direction: row;
    gap: 12px;
    text-align: left;
    padding-top: 0;
    margin-top: 4px;
  }
  .work-arrow { grid-column: 3 / 4; grid-row: 1 / 2; }
  .principles { grid-template-columns: 1fr; }
  .principle { padding: 28px 0; }
  .principle + .principle {
    border-left: none;
    border-top: 1px solid var(--line-soft);
    padding-left: 0;
  }
  .principle p { max-width: 52ch; }
  .about-grid { grid-template-columns: 1fr; gap: 34px; }
  .about-left .h2 { position: static; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .section { padding: 82px 0; }
  .section-head { margin-bottom: 44px; }
  .hero { padding: 128px 0 72px; }
  .lede { font-size: 16.5px; margin-top: 24px; }
  .hero-actions { margin-top: 32px; }
  .hero-meta { margin-top: 34px; }
  .btn { width: 100%; justify-content: center; }
  .header-cta { width: auto; }
  .hero-actions .btn { width: auto; flex: 1 1 100%; }
  .fact { grid-template-columns: 1fr; gap: 6px; }
  .fact dt { padding-top: 0; }
  .stack-list { grid-template-columns: 1fr; }
  .stack-list li {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 18px;
    padding: 15px 0;
    border-left: none !important;
    padding-left: 0 !important;
  }
  .stack-list li + li {
    border-top: 1px solid var(--line-soft);
  }
  .stack-val { font-size: 15.5px; text-align: right; }
  .contact { padding-top: 86px; }
  .footer-inner { flex-direction: column; }
  .display { font-size: clamp(2.1rem, 9vw, 2.9rem); }
  .work-desc { font-size: 15px; }
}

@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;
  }
  .reveal { opacity: 1; transform: none; }
}
