:root {
  color-scheme: light;
  --surface: #f4efe6;
  --surface-2: #ebe1d1;
  --panel: rgba(255, 252, 245, 0.82);
  --panel-solid: #fffaf1;
  --text: #17130e;
  --paper: #3f362d;
  --muted: #877766;
  --line: rgba(23, 19, 14, 0.18);
  --red: #9d3f31;
  --red-hot: #bf5945;
  --inverse: #0b0a08;
  --inverse-text: #f4efe6;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: "Inter", "Aptos", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Roboto Mono", "Consolas", monospace;
  --motion-border: rgba(5, 5, 5, 0.44);
  --motion-border-size: 1px;
}

:is(body.theme-dark, html[data-editorial-theme="dark"] body) {
  color-scheme: dark;
  --surface: #050505;
  --surface-2: #0d0c0a;
  --panel: rgba(20, 18, 15, 0.82);
  --panel-solid: #14120f;
  --text: #f1eadf;
  --paper: #d8cbb7;
  --muted: #8e8374;
  --line: rgba(241, 234, 223, 0.18);
  --red: #a83e2d;
  --red-hot: #d45a43;
  --inverse: #f1eadf;
  --inverse-text: #050505;
  --motion-border: rgba(241, 234, 223, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body,
a,
button,
input,
.paper-noise,
.theme-wash,
.archive-header,
.hero-statement,
.archive-card,
.journal-item {
  transition:
    background-color 520ms ease,
    background 520ms ease,
    border-color 520ms ease,
    color 520ms ease,
    opacity 520ms ease,
    box-shadow 520ms ease;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(23, 19, 14, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 76% 12%, rgba(157, 63, 49, 0.13), transparent 26rem),
    linear-gradient(135deg, var(--surface), var(--surface-2) 52%, #ded1bd);
  background-size: 72px 100%, auto, auto;
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
}

:is(body.theme-dark, html[data-editorial-theme="dark"] body) {
  background:
    linear-gradient(90deg, rgba(241, 234, 223, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 76% 12%, rgba(168, 62, 45, 0.18), transparent 26rem),
    linear-gradient(135deg, var(--surface), var(--surface-2) 52%, #17120d);
  background-size: 72px 100%, auto, auto;
}

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

.paper-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.38;
  background:
    linear-gradient(rgba(23, 19, 14, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 19, 14, 0.018) 1px, transparent 1px);
  background-size: 100% 7px, 42px 100%;
  mask-image: linear-gradient(to bottom, transparent, black 12%, black 90%, transparent);
}

.motion-lines-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.38;
  mix-blend-mode: multiply;
}

:is(body.theme-dark, html[data-editorial-theme="dark"] body) .motion-lines-canvas {
  opacity: 0.48;
  mix-blend-mode: screen;
}

.theme-wash {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 16%, rgba(157, 63, 49, 0.18), transparent 32rem);
}

body.theme-shifting .theme-wash {
  animation: theme-wash 620ms ease;
}

:is(body.theme-dark, html[data-editorial-theme="dark"] body) .paper-noise {
  opacity: 0.42;
  background:
    linear-gradient(rgba(241, 234, 223, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(241, 234, 223, 0.016) 1px, transparent 1px);
  background-size: 100% 7px, 42px 100%;
}

.archive-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 5vw;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(18px);
}

.archive-brand {
  display: grid;
  gap: 0.1rem;
}

.archive-brand span {
  font-family: var(--font-serif);
  font-size: 1.06rem;
}

.archive-brand small,
nav,
.kicker,
.hero-index,
.archive-card span,
time,
.journal-item > div p,
label,
.button,
.card-link,
.modal-close,
button {
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.archive-brand small {
  color: var(--muted);
  font-size: 0.66rem;
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2.4vw, 1.5rem);
  color: var(--muted);
  font-size: 0.72rem;
}

nav a:hover,
.theme-toggle:hover {
  color: var(--red-hot);
}

nav a,
.button,
form button,
.card-link,
.modal-close,
.text-link,
.theme-toggle {
  transition:
    color 240ms ease,
    background-color 240ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease,
    transform 240ms ease;
}

nav a:hover,
.text-link:hover {
  text-shadow: 0 0 18px color-mix(in srgb, var(--red-hot) 36%, transparent);
}

.theme-toggle {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--red-hot) 14%, transparent), transparent),
    color-mix(in srgb, var(--panel-solid) 72%, transparent);
  color: var(--text);
  padding: 0.4rem 0.72rem;
  font-size: 0.68rem;
  cursor: pointer;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--inverse) 8%, transparent);
}

.theme-toggle::before {
  content: "";
  display: inline-block;
  width: 0.48rem;
  height: 0.48rem;
  margin-right: 0.45rem;
  border-radius: 999px;
  background: var(--red-hot);
  box-shadow: 0 0 12px color-mix(in srgb, var(--red-hot) 55%, transparent);
  vertical-align: 0.02rem;
}

.archive-hero,
.archive-grid,
.journal-section,
.portfolio-section,
.page-hero,
.project-index,
.case-hero,
.case-visual,
.case-body,
.case-tags,
.related-projects {
  width: min(1180px, 90vw);
  margin: 0 auto;
}

.archive-hero {
  min-height: auto;
  display: grid;
  grid-template-columns: 0.28fr 1.28fr 0.56fr;
  gap: 1rem;
  align-items: end;
  padding: clamp(1rem, 2.4vw, 2rem) 0;
}

.hero-index {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: clamp(430px, 56vh, 520px);
  border-left: 1px solid var(--line);
  padding-left: 1rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.hero-index p {
  writing-mode: vertical-rl;
  margin: 0;
}

.hero-statement {
  display: flex;
  flex-direction: column;
  justify-content: end;
  min-height: clamp(430px, 56vh, 520px);
  border: 1px solid transparent;
  padding: clamp(1rem, 2.2vw, 1.65rem);
  background:
    linear-gradient(135deg, rgba(157, 63, 49, 0.1), transparent 35%),
    var(--panel);
}

.kicker {
  margin: 0 0 1rem;
  color: var(--red-hot);
  font-size: 0.7rem;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 0.96;
}

h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 500;
}

h1 {
  max-width: 820px;
  font-size: clamp(3.6rem, 8vw, 8rem);
}

.hero-statement h1 {
  max-width: 760px;
  font-size: clamp(3.1rem, 5.45vw, 5.9rem);
  line-height: 0.91;
}

h2 {
  font-size: clamp(2.2rem, 5vw, 5.2rem);
}

h3 {
  font-size: 1.08rem;
}

.hero-statement > p:not(.kicker),
.archive-card p,
.journal-item p {
  color: var(--paper);
}

.hero-statement > p:not(.kicker) {
  max-width: 720px;
  font-size: clamp(0.98rem, 1.35vw, 1.14rem);
}

.archive-card p {
  margin: 0.7rem 0 0;
  font-size: 0.94rem;
  line-height: 1.42;
}

.archive-actions,
.input-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.archive-actions {
  margin-top: clamp(1rem, 2vw, 1.3rem);
}

.button,
form button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.78rem 1rem;
  background: transparent;
  color: var(--text);
  font-size: 0.74rem;
  cursor: pointer;
}

.card-link {
  width: fit-content;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.button.primary,
form button {
  border-color: color-mix(in srgb, var(--red-hot) 70%, transparent);
  background: var(--red);
  color: #fff8ed;
}

.button:hover,
form button:hover,
.theme-toggle:hover {
  box-shadow:
    0 14px 32px color-mix(in srgb, var(--inverse) 14%, transparent);
  transform: translateY(-1px);
}

:is(body.theme-dark, html[data-editorial-theme="dark"] body) .button.primary,
:is(body.theme-dark, html[data-editorial-theme="dark"] body) form button {
  color: #050505;
}

.archive-card {
  border: 1px solid transparent;
  padding: 0.85rem;
  background: var(--panel);
  position: relative;
  overflow: visible;
  transition:
    background-color 360ms ease,
    border-color 360ms ease,
    box-shadow 360ms ease,
    color 360ms ease,
    transform 360ms ease;
}

.hero-statement,
.archive-card,
.portfolio-item,
.project-card,
.case-meta,
.case-body article,
.case-tags span,
.simple-journal-item {
  position: relative;
}

.hero-statement::before,
.archive-card::before,
.portfolio-item::before,
.project-card::before,
.case-meta::before,
.case-body article::before,
.case-tags span::before,
.simple-journal-item::before,
.journal-item::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background:
    linear-gradient(var(--motion-border), var(--motion-border)) right bottom / var(--motion-border-size) 0 no-repeat,
    linear-gradient(270deg, var(--motion-border), var(--motion-border)) top right / 0 var(--motion-border-size) no-repeat,
    linear-gradient(90deg, var(--motion-border), var(--motion-border)) bottom right / 0 var(--motion-border-size) no-repeat,
    linear-gradient(var(--motion-border), var(--motion-border)) left bottom / var(--motion-border-size) 0 no-repeat;
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease;
}

.hero-statement::after,
.archive-card::after,
.portfolio-item::after,
.project-card::after,
.case-meta::after,
.case-body article::after,
.case-tags span::after,
.simple-journal-item::after,
.journal-item::after {
  content: none;
}

.hero-statement:hover,
.archive-card:hover,
.portfolio-item:hover,
.project-card:hover,
.case-meta:hover,
.case-body article:hover,
.case-tags span:hover,
.simple-journal-item:hover {
  border-color: transparent;
  box-shadow:
    0 18px 48px color-mix(in srgb, var(--inverse) 13%, transparent);
  transform: translateY(-3px);
}

.hero-statement:hover::before,
.archive-card:hover::before,
.portfolio-item:hover::before,
.project-card:hover::before,
.case-meta:hover::before,
.case-body article:hover::before,
.case-tags span:hover::before,
.simple-journal-item:hover::before,
.journal-item:hover::before {
  opacity: 1;
  animation: editorial-border-draw 360ms linear forwards;
}

.hero-statement:hover::after,
.archive-card:hover::after,
.portfolio-item:hover::after,
.project-card:hover::after,
.case-meta:hover::after,
.case-body article:hover::after,
.case-tags span:hover::after,
.simple-journal-item:hover::after,
.journal-item:hover::after {
  content: none;
}

.issue-card {
  align-self: end;
  padding: clamp(0.85rem, 1.6vw, 1rem);
}

.profile-card {
  align-self: end;
  display: grid;
  gap: 0.85rem;
  padding: 0.85rem;
}

.profile-photo-frame {
  aspect-ratio: 4 / 5;
  min-height: 260px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--red-hot) 20%, transparent), transparent 12rem),
    linear-gradient(145deg, var(--panel-solid), var(--surface-2));
  position: relative;
  overflow: hidden;
}

:is(body.theme-dark, html[data-editorial-theme="dark"] body) .profile-photo-frame {
  background:
    radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--red-hot) 28%, transparent), transparent 12rem),
    linear-gradient(145deg, #17120d, #050505);
}

.profile-photo {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.015);
  transition:
    opacity 900ms ease,
    transform 1200ms ease,
    filter 900ms ease;
  will-change: opacity, transform;
  filter: saturate(0.98) contrast(0.98);
}

.profile-photo-light.profile-photo-a {
  opacity: 1;
  transform: scale(1);
  filter: saturate(1) contrast(1);
}

.profile-photo-light.profile-photo-b {
  opacity: 0;
}

.profile-card:hover .profile-photo-frame.has-light-pair .profile-photo-light.profile-photo-a {
  opacity: 0;
}

.profile-card:hover .profile-photo-frame.has-light-pair .profile-photo-light.profile-photo-b {
  opacity: 1;
  transform: scale(1);
  filter: saturate(1) contrast(1);
}

:is(body.theme-dark, html[data-editorial-theme="dark"] body) .profile-photo-light {
  opacity: 0;
  animation: none;
}

:is(body.theme-dark, html[data-editorial-theme="dark"] body) .profile-photo-dark.profile-photo-a {
  opacity: 1;
  transform: scale(1);
  filter: saturate(1) contrast(1);
}

:is(body.theme-dark, html[data-editorial-theme="dark"] body) .profile-photo-frame.has-dark-pair .profile-photo-dark.profile-photo-a {
  opacity: 1;
}

:is(body.theme-dark, html[data-editorial-theme="dark"] body) .profile-photo-frame.has-dark-pair .profile-photo-dark.profile-photo-b {
  opacity: 0;
}

:is(body.theme-dark, html[data-editorial-theme="dark"] body) .profile-card:hover .profile-photo-frame.has-dark-pair .profile-photo-dark.profile-photo-a {
  opacity: 0;
}

:is(body.theme-dark, html[data-editorial-theme="dark"] body) .profile-card:hover .profile-photo-frame.has-dark-pair .profile-photo-dark.profile-photo-b {
  opacity: 1;
  transform: scale(1);
  filter: saturate(1) contrast(1);
}

.profile-photo-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--text) 72%, transparent);
}

.profile-photo-placeholder span {
  margin: 0;
  color: inherit;
  font-family: var(--font-serif);
  font-size: clamp(3.2rem, 7vw, 5rem);
  line-height: 1;
}

.profile-card p {
  margin: 0;
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  line-height: 1.1;
}

.archive-card span {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--red-hot);
  font-size: 0.68rem;
}

.archive-card strong {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 3.4rem);
  font-weight: 500;
  line-height: 0.95;
}

.archive-grid {
  display: grid;
  grid-template-columns: 1.24fr 0.62fr 0.62fr;
  gap: 1rem;
  padding: 0 0 4rem;
}

.archive-card.wide {
  grid-row: span 2;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.archive-card.inverted {
  grid-column: span 2;
  background: var(--inverse);
  color: var(--inverse-text);
}

.archive-card.inverted .kicker,
.archive-card.inverted .status {
  color: var(--red-hot);
}

.archive-card.inverted p {
  color: color-mix(in srgb, var(--inverse-text) 78%, transparent);
}

form label {
  display: block;
  margin: 1rem 0 0.4rem;
  font-size: 0.72rem;
}

input {
  width: min(100%, 420px);
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--inverse-text) 22%, transparent);
  background: color-mix(in srgb, var(--inverse-text) 8%, transparent);
  color: var(--inverse-text);
  padding: 0.78rem 0.85rem;
  font: inherit;
}

input:focus {
  outline: 1px solid var(--red);
}

.contact-chat-button {
  margin-top: 1rem;
}

.chat-dock {
  position: fixed;
  right: clamp(0.8rem, 3vw, 1.5rem);
  bottom: clamp(0.8rem, 3vw, 1.5rem);
  z-index: 40;
  width: min(420px, calc(100vw - 1.6rem));
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition:
    opacity 260ms ease,
    transform 260ms ease;
}

.chat-dock.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.chat-panel {
  max-height: min(720px, calc(100vh - 1.6rem));
  display: grid;
  grid-template-rows: auto minmax(190px, 1fr) auto auto;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--red-hot) 12%, transparent), transparent 32%),
    var(--panel-solid);
  color: var(--text);
  box-shadow: 0 26px 76px color-mix(in srgb, #000 32%, transparent);
}

.chat-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.chat-head h2 {
  font-size: clamp(1.45rem, 5vw, 2.35rem);
}

.chat-close {
  min-height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0.45rem 0.65rem;
  font-size: 0.66rem;
  cursor: pointer;
}

.chat-messages {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  overflow: auto;
  padding: 1rem;
}

.chat-message {
  width: fit-content;
  max-width: 88%;
  margin: 0;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 74%, transparent);
  padding: 0.62rem 0.72rem;
  color: var(--paper);
  font-size: 0.9rem;
  line-height: 1.36;
}

.chat-message span {
  display: block;
  margin-bottom: 0.22rem;
  color: var(--red-hot);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
}

.chat-message.visitor {
  justify-self: end;
  background: var(--inverse);
  color: var(--inverse-text);
}

.chat-message.admin {
  border-color: color-mix(in srgb, var(--red-hot) 54%, transparent);
}

.chat-contact-form,
.chat-reply-form {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border-top: 1px solid var(--line);
}

.chat-contact-form[hidden],
.chat-reply-form[hidden] {
  display: none;
}

.chat-contact-form label,
.chat-reply-form label {
  margin: 0;
  color: var(--muted);
}

.chat-contact-form input,
.chat-reply-form input {
  width: 100%;
  color: var(--text);
  border-color: var(--line);
  background: color-mix(in srgb, var(--panel) 72%, transparent);
}

.chat-contact-form button,
.chat-reply-form button {
  min-height: 42px;
}

.status {
  margin: 0.8rem 0 0;
  color: var(--red-hot);
  font-size: 0.82rem;
}

.status.error {
  color: #ffb3a5;
}

.portfolio-section,
.journal-section {
  padding: 4rem 0 5rem;
  border-top: 1px solid var(--line);
}

.stack-trigger-card {
  display: flex;
  flex-direction: column;
}

.stack-trigger-card .card-link {
  margin-top: auto;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2rem);
  background: color-mix(in srgb, var(--inverse) 62%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.stack-modal {
  width: min(1040px, 100%);
  max-height: min(760px, 88vh);
  overflow: auto;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--red-hot) 12%, transparent), transparent 28%),
    var(--panel-solid);
  color: var(--text);
  padding: clamp(1rem, 2.6vw, 1.5rem);
  box-shadow: 0 30px 80px color-mix(in srgb, #000 36%, transparent);
  transform: translateY(12px);
  transition: transform 260ms ease;
}

.modal-overlay.is-open .stack-modal {
  transform: translateY(0);
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-head h2 {
  max-width: 760px;
  font-size: clamp(2rem, 4.6vw, 4.8rem);
}

.modal-close {
  min-height: 38px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0.6rem 0.8rem;
  font-size: 0.68rem;
  cursor: pointer;
}

.modal-close:hover {
  border-color: color-mix(in srgb, var(--red-hot) 68%, transparent);
  color: var(--red-hot);
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.stack-grid .archive-card {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.portfolio-list,
.project-index,
.related-grid {
  display: grid;
  gap: 1rem;
}

.portfolio-list {
  margin-bottom: 1rem;
}

.portfolio-item,
.project-card {
  display: grid;
  grid-template-columns: minmax(240px, 0.58fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
  border: 1px solid transparent;
  background: var(--panel);
  padding: 1rem;
  overflow: visible;
  transition:
    border-color 360ms ease,
    box-shadow 360ms ease,
    transform 360ms ease;
}

.project-thumb,
.case-visual {
  min-height: 300px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 20% 18%, color-mix(in srgb, var(--red-hot) 36%, transparent), transparent 18rem),
    linear-gradient(145deg, color-mix(in srgb, var(--panel-solid) 80%, var(--red)), var(--surface-2));
  position: relative;
  overflow: visible;
  transition:
    box-shadow 360ms ease,
    filter 360ms ease,
    transform 360ms ease;
}

.card-border-motion {
  position: absolute;
  inset: -1px;
  z-index: 5;
  border-radius: inherit;
  pointer-events: none;
}

.card-border-motion::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(var(--motion-border), var(--motion-border)) right bottom / var(--motion-border-size) 0 no-repeat,
    linear-gradient(270deg, var(--motion-border), var(--motion-border)) top right / 0 var(--motion-border-size) no-repeat,
    linear-gradient(90deg, var(--motion-border), var(--motion-border)) bottom right / 0 var(--motion-border-size) no-repeat,
    linear-gradient(var(--motion-border), var(--motion-border)) left bottom / var(--motion-border-size) 0 no-repeat;
  opacity: 0;
  transition: opacity 320ms ease;
}

.card-border-motion::after {
  content: none;
}

.project-thumb:hover .card-border-motion::before,
.portfolio-item:hover .project-thumb .card-border-motion::before,
.project-card:hover .project-thumb .card-border-motion::before,
.case-visual:hover .card-border-motion::before {
  opacity: 1;
  animation: editorial-border-draw 360ms linear forwards;
}

.project-thumb:hover .card-border-motion::after,
.portfolio-item:hover .project-thumb .card-border-motion::after,
.project-card:hover .project-thumb .card-border-motion::after,
.case-visual:hover .card-border-motion::after {
  content: none;
}

.project-thumb::before,
.project-thumb::after,
.case-visual::before,
.case-visual::after {
  content: "";
  position: absolute;
  inset: 13%;
  border: 1px solid color-mix(in srgb, var(--inverse) 18%, transparent);
  transform: rotate(-6deg);
}

.project-thumb::after,
.case-visual::after {
  inset: 25% 10% 18% 34%;
  border-color: color-mix(in srgb, var(--red-hot) 48%, transparent);
  transform: rotate(10deg);
}

.portfolio-item:hover .project-thumb,
.project-card:hover .project-thumb,
.case-visual:hover {
  box-shadow:
    0 18px 48px color-mix(in srgb, var(--inverse) 18%, transparent);
  filter: saturate(1.1) contrast(1.04);
}

.project-thumb::before,
.project-thumb::after,
.case-visual::before,
.case-visual::after {
  transition: transform 420ms ease, border-color 420ms ease;
}

.portfolio-item:hover .project-thumb::before,
.project-card:hover .project-thumb::before,
.case-visual:hover::before {
  transform: rotate(-3deg) scale(1.04);
}

.portfolio-item:hover .project-thumb::after,
.project-card:hover .project-thumb::after,
.case-visual:hover::after {
  transform: rotate(13deg) scale(1.03);
}

.visual-two {
  background:
    radial-gradient(circle at 78% 22%, color-mix(in srgb, var(--paper) 32%, transparent), transparent 16rem),
    linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--red) 28%, var(--surface-2)));
}

.visual-three {
  background:
    radial-gradient(circle at 42% 28%, color-mix(in srgb, var(--red-hot) 34%, transparent), transparent 18rem),
    linear-gradient(135deg, color-mix(in srgb, var(--paper) 22%, var(--surface)), var(--inverse));
}

.portfolio-item h3,
.project-card h2 {
  font-family: var(--font-serif);
  font-weight: 500;
}

.portfolio-item h3 {
  font-size: clamp(1.65rem, 3.2vw, 3.1rem);
}

.project-card h2 {
  font-size: clamp(1.75rem, 3.8vw, 3.8rem);
}

.text-link {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--red-hot);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.page-hero,
.case-hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 4rem);
}

.page-hero > p:not(.kicker),
.case-hero > div > p:not(.kicker) {
  max-width: 760px;
  color: var(--paper);
  font-size: clamp(1.02rem, 1.6vw, 1.22rem);
}

.case-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.36fr);
  gap: 1rem;
  align-items: end;
}

.case-meta {
  display: grid;
  gap: 0.45rem;
  border: 1px solid transparent;
  background: var(--panel);
  padding: 1rem;
}

.case-meta span,
.case-tags span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.case-meta strong {
  margin-bottom: 1rem;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 500;
}

.case-visual {
  min-height: clamp(360px, 48vw, 640px);
}

.case-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 2rem 0;
}

.case-body article {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.case-body p:not(.kicker) {
  color: var(--paper);
  margin: 0;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 4rem;
}

.case-tags span {
  border: 1px solid transparent;
  background: var(--panel);
  padding: 0.45rem 0.65rem;
}

.related-projects {
  padding: 4rem 0 5rem;
  border-top: 1px solid var(--line);
}

.related-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.simple-journal-hero,
.simple-journal-list {
  width: min(900px, 90vw);
  margin: 0 auto;
}

.simple-journal-hero {
  padding: clamp(4rem, 10vw, 7rem) 0 clamp(2rem, 5vw, 3rem);
  border-bottom: 1px solid var(--line);
}

.simple-journal-hero h1 {
  font-size: clamp(4rem, 11vw, 9rem);
}

.simple-journal-hero p:not(.kicker) {
  max-width: 680px;
  color: var(--paper);
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
}

.simple-journal-list {
  display: grid;
  padding: 2rem 0 6rem;
}

.simple-journal-item {
  display: grid;
  grid-template-columns: 0.24fr 1fr;
  gap: 1rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--line);
  transition:
    border-color 300ms ease,
    padding 300ms ease,
    background-color 300ms ease,
    transform 300ms ease;
}

.simple-journal-item:hover {
  padding-inline: 0.85rem;
  background: color-mix(in srgb, var(--panel) 44%, transparent);
  transform: translateX(4px);
}

.simple-journal-item time {
  padding-top: 0.25rem;
}

.simple-journal-item h2 {
  font-size: clamp(1.8rem, 4vw, 3.8rem);
}

.simple-journal-item p:not(.kicker) {
  color: var(--paper);
  margin-bottom: 0;
}

.journal-heading {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
}

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

.journal-item {
  display: grid;
  grid-template-columns: 0.38fr 0.72fr 1fr;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: visible;
  border-radius: 6px;
  transition:
    border-color 300ms ease,
    padding 300ms ease,
    background-color 300ms ease,
    transform 300ms ease;
}

.journal-item:hover {
  padding-inline: 0.85rem;
  border-color: transparent;
  background: color-mix(in srgb, var(--panel) 42%, transparent);
  transform: translateX(4px);
}

time,
.journal-item > div p {
  color: var(--muted);
  font-size: 0.7rem;
}

.journal-item > div p {
  margin: 0.35rem 0 0;
}

.journal-item h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.8rem);
  font-weight: 500;
}

.journal-item > p {
  margin: 0;
}

@media (max-width: 920px) {
  .archive-hero,
  .archive-grid,
  .journal-item,
  .portfolio-item,
  .project-card,
  .case-hero,
  .case-body,
  .related-grid,
  .simple-journal-item {
    grid-template-columns: 1fr;
  }

  .stack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-index {
    min-height: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 1rem 0 0;
  }

  .hero-index p {
    writing-mode: initial;
  }

  .archive-card.wide,
  .archive-card.inverted {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .archive-header {
    display: grid;
    justify-items: start;
    padding-block: 1rem;
  }

  nav {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .hero-statement,
  .hero-index {
    min-height: auto;
  }

  .input-row {
    display: grid;
  }

  .modal-head {
    display: grid;
  }

  .chat-dock {
    right: 0.8rem;
    bottom: 0.8rem;
  }

  .stack-grid {
    grid-template-columns: 1fr;
  }
}

@keyframes theme-wash {
  0% {
    opacity: 0;
  }
  35% {
    opacity: 0.55;
  }
  100% {
    opacity: 0;
  }
}


@keyframes editorial-border-draw {
  0% {
    background-size: var(--motion-border-size) 0, 0 var(--motion-border-size), 0 var(--motion-border-size), var(--motion-border-size) 0;
  }
  56% {
    background-size: var(--motion-border-size) 100%, 0 var(--motion-border-size), 100% var(--motion-border-size), var(--motion-border-size) 0;
  }
  100% {
    background-size: var(--motion-border-size) 100%, 78% var(--motion-border-size), 100% var(--motion-border-size), var(--motion-border-size) 68%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  body,
  a,
  button,
  input,
  .paper-noise,
  .theme-wash,
  .archive-header,
  .hero-statement,
  .archive-card,
  .journal-item {
    transition: none;
  }

  body.theme-shifting .theme-wash {
    animation: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
