:root {
  color-scheme: light;
  --paper: #f6f1e8;
  --paper-deep: #ece2d4;
  --ink: #24211d;
  --muted: #6d665d;
  --line: #d8ccbc;
  --clay: #b15f3b;
  --clay-dark: #7c412c;
  --sage: #6f7462;
  --white: #fffaf2;
  --shadow: 0 24px 70px rgba(74, 54, 37, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.6;
}

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

button,
input,
textarea {
  font: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 18px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid rgba(36, 33, 29, 0.08);
  background: rgba(246, 241, 232, 0.84);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 680;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-size: 12px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
  color: var(--muted);
  font-size: 15px;
}

.site-nav a {
  padding: 8px 0;
  border-bottom: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--ink);
  border-color: var(--clay);
}

.account-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  margin-left: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px 4px 4px;
  background: rgba(255, 250, 242, 0.7);
  color: var(--ink);
}

.account-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper-deep);
  font-size: 12px;
  font-weight: 760;
}

.account-avatar img,
.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-name {
  max-width: 90px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1px;
  margin: 5px auto;
  background: var(--ink);
}

.hero {
  position: relative;
  min-height: min(760px, 92vh);
  overflow: hidden;
  display: grid;
  align-items: end;
  padding: 120px clamp(20px, 6vw, 84px) 58px;
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(246, 241, 232, 0.96) 0%, rgba(246, 241, 232, 0.74) 43%, rgba(246, 241, 232, 0.2) 76%),
    linear-gradient(0deg, rgba(246, 241, 232, 0.84) 0%, rgba(246, 241, 232, 0) 38%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--clay-dark);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

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

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(64px, 12vw, 148px);
  font-weight: 500;
}

h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 500;
}

h3 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 620;
}

.hero-copy {
  max-width: 620px;
  margin: 20px 0 0;
  color: #454038;
  font-size: clamp(18px, 2.1vw, 24px);
}

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

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.button.subtle {
  background: rgba(255, 250, 242, 0.62);
}

.intro-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-deep);
}

.intro-band p {
  margin: 0;
  min-height: 74px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.intro-band p:last-child {
  border-right: 0;
}

.section {
  padding: clamp(64px, 10vw, 128px) clamp(20px, 6vw, 84px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-kicker {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.filter-chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.filter-chip.active {
  border-color: var(--clay);
  background: #ead7c8;
  color: var(--clay-dark);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.post-card {
  display: flex;
  min-height: 420px;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.72);
  box-shadow: var(--shadow);
}

.post-card.featured {
  background: #f2e1d3;
}

.post-card[hidden] {
  display: none;
}

.post-meta {
  margin: 0 0 22px;
  color: var(--sage);
  font-size: 13px;
  font-weight: 720;
}

.post-card p:not(.post-meta) {
  margin: 24px 0 34px;
  color: var(--muted);
}

.post-card a {
  width: fit-content;
  border-bottom: 1px solid var(--clay);
  color: var(--clay-dark);
  font-weight: 700;
}

.social-projects {
  background: var(--paper-deep);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.social-card {
  position: relative;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 34px;
  gap: 20px;
  min-height: 260px;
  align-items: start;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.8);
  box-shadow: var(--shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.social-card:hover {
  transform: translateY(-3px);
  border-color: var(--clay);
  background: var(--white);
}

.social-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  font-weight: 760;
}

.social-card h3,
.project-card h3 {
  margin-bottom: 18px;
}

.social-card p:not(.post-meta),
.project-card p:not(.post-meta) {
  margin: 0;
  color: var(--muted);
}

.card-arrow {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--clay-dark);
}

.projects {
  background: var(--paper);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.project-card {
  display: flex;
  min-height: 390px;
  flex-direction: column;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.72);
}

.project-card:nth-child(2) {
  background: #f2e1d3;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: auto 0 28px;
  padding-top: 28px;
}

.project-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--sage);
  font-size: 13px;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.project-card a,
.project-links a {
  width: fit-content;
  border-bottom: 1px solid var(--clay);
  color: var(--clay-dark);
  font-weight: 700;
}

.reading-page {
  background: var(--paper);
}

.reading-nav {
  gap: 20px;
}

.reading-shell {
  padding: 118px clamp(20px, 6vw, 84px) clamp(64px, 10vw, 120px);
}

.reading-article {
  max-width: 900px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  margin-bottom: 36px;
  color: var(--clay-dark);
  font-weight: 700;
}

.reading-article h1 {
  max-width: 860px;
  font-size: clamp(44px, 8vw, 92px);
}

.article-meta {
  margin-top: 22px;
  color: var(--sage);
  font-size: 14px;
  font-weight: 720;
}

.article-excerpt {
  max-width: 760px;
  margin: 28px 0 0;
  color: #454038;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.45;
}

.article-cover-wrap {
  margin-top: 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.article-cover-wrap img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.article-content {
  margin-top: 48px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.article-content p {
  max-width: 760px;
  margin: 0 0 24px;
  color: #3f3931;
  font-size: clamp(18px, 2.2vw, 21px);
  line-height: 1.9;
}

.profile-shell {
  padding: 118px clamp(20px, 6vw, 84px) clamp(64px, 10vw, 120px);
}

.profile-hero {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 28px;
  max-width: 1120px;
  align-items: center;
  margin: 0 auto 28px;
}

.profile-avatar-large {
  display: grid;
  width: 112px;
  height: 112px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
}

.profile-subtitle {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
}

.profile-panel {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.76);
  box-shadow: var(--shadow);
}

.compact-heading {
  margin-bottom: 22px;
}

.profile-form {
  display: grid;
  gap: 16px;
}

.profile-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.profile-form input,
.profile-form textarea,
.profile-form select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--paper);
  color: var(--ink);
}

.profile-form textarea {
  resize: vertical;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.control-card {
  display: grid;
  min-height: 220px;
  align-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--white);
}

.control-card span {
  color: var(--clay-dark);
  font-size: 13px;
  font-weight: 760;
}

.control-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 500;
}

.control-card p {
  margin: 0;
  color: var(--muted);
}

.auth-required {
  max-width: 720px;
  margin: 0 auto;
}

.content-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
}

.personal-list {
  display: grid;
  gap: 12px;
}

.personal-item {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--white);
}

.personal-item h3,
.personal-item p {
  margin: 0;
}

.personal-item p:not(.post-meta) {
  color: var(--muted);
}

.content-status {
  max-width: 1120px;
  margin: 18px auto 0;
}

.login-shell {
  min-height: 100vh;
  padding: 118px clamp(20px, 6vw, 84px) clamp(64px, 10vw, 120px);
  display: grid;
  align-items: center;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  gap: clamp(30px, 6vw, 80px);
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.78);
  box-shadow: var(--shadow);
}

.login-copy p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
}

.login-form {
  display: grid;
  align-self: start;
  gap: 16px;
}

.login-mode {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.login-mode button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.login-mode button.active {
  background: var(--ink);
  color: var(--white);
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.login-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--paper);
  color: var(--ink);
}

.notes {
  background: #26231f;
  color: var(--white);
}

.notes .eyebrow {
  color: #e0b59b;
}

.note-list {
  border-top: 1px solid rgba(255, 250, 242, 0.22);
}

.note-list article {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid rgba(255, 250, 242, 0.18);
}

.note-list span {
  color: #d9b397;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.note-list p {
  margin: 0;
  max-width: 900px;
  color: #eee2d4;
  font-size: clamp(20px, 3vw, 34px);
  line-height: 1.35;
}

.about-letter {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  gap: clamp(32px, 6vw, 78px);
  padding: clamp(64px, 10vw, 128px) clamp(20px, 6vw, 84px);
  background: var(--paper-deep);
}

.about-copy p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
}

.letter-form {
  align-self: start;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.letter-form label {
  display: block;
  margin: 26px 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.email-row {
  display: flex;
  gap: 10px;
}

.email-row input {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
}

.form-status {
  min-height: 24px;
  margin: 16px 0 0;
  color: var(--clay-dark);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(20px, 6vw, 84px);
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: 72px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 12px;
  }

  .account-link {
    margin-left: auto;
  }

  .account-name {
    display: none;
  }

  .reading-nav {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    border: 0;
    padding: 0;
    box-shadow: none;
    background: transparent;
  }

  .reading-nav a {
    padding: 8px 0;
  }

  .hero {
    min-height: 720px;
    padding-top: 108px;
  }

  .hero-shade {
    background:
      linear-gradient(180deg, rgba(246, 241, 232, 0.72) 0%, rgba(246, 241, 232, 0.9) 58%, rgba(246, 241, 232, 0.98) 100%),
      linear-gradient(90deg, rgba(246, 241, 232, 0.9), rgba(246, 241, 232, 0.22));
  }

  .intro-band,
  .post-grid,
  .social-grid,
  .project-grid,
  .profile-grid,
  .control-grid,
  .login-panel,
  .content-workspace,
  .about-letter {
    grid-template-columns: 1fr;
  }

  .intro-band p {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .intro-band p:last-child {
    border-bottom: 0;
  }

  .post-card {
    min-height: 320px;
  }

  .social-card,
  .project-card {
    min-height: auto;
  }

  .section-heading {
    display: block;
  }

  .section-kicker {
    margin-top: 14px;
  }

  .email-row {
    flex-direction: column;
  }

  .site-footer {
    display: block;
  }

  .site-footer p + p {
    margin-top: 8px;
  }

  .reading-shell {
    padding-top: 104px;
  }

  .profile-shell {
    padding-top: 104px;
  }

  .login-shell {
    padding-top: 104px;
  }
}

@media (max-width: 520px) {
  .site-header {
    min-height: 66px;
    padding: 14px 16px;
  }

  .site-nav {
    top: 66px;
  }

  .hero {
    min-height: 680px;
    padding: 96px 18px 38px;
  }

  .profile-hero {
    grid-template-columns: 1fr;
  }

  .profile-avatar-large {
    width: 92px;
    height: 92px;
    font-size: 28px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button {
    width: 100%;
  }

  .section,
  .about-letter {
    padding-left: 18px;
    padding-right: 18px;
  }

  .note-list article {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .social-card {
    grid-template-columns: 1fr;
  }

  .card-arrow {
    position: absolute;
    top: 18px;
    right: 18px;
  }
}
