:root {
  --ink: #111111;
  --paper: #fbfaf7;
  --line: #222222;
  --muted: #6e6a63;
  --acid: #cdf567;
  --cyan: #00a7a5;
  --red: #f05a28;
  --lilac: #d8d1ff;
  --white: #ffffff;
  --shadow: 0 18px 60px rgba(17, 17, 17, 0.12);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-width: 320px;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

main,
section,
article,
div,
a,
p,
h1,
h2,
h3,
strong,
span,
dd,
td,
th {
  min-width: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

p,
h1,
h2,
h3,
strong,
span,
dd,
td,
th,
.button,
.site-nav a,
.filter-row a,
.tag-row a {
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.site-shell {
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(17, 17, 17, 0.06) 1px, transparent 1px),
    var(--paper);
  background-size: 64px 64px;
}

.site-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 24px;
}

.brand-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  width: max-content;
  border: 2px solid var(--ink);
  background: var(--white);
  box-shadow: 5px 5px 0 var(--ink);
  font-weight: 950;
  line-height: 1;
}

.brand-mark span {
  padding: 8px 10px;
}

.brand-mark span:last-child {
  color: var(--paper);
  background: var(--ink);
}

.site-nav,
.language-switcher,
.action-row,
.filter-row,
.tag-row,
.toggle-row,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.site-nav {
  justify-content: end;
}

.site-nav a,
.filter-row a,
.tag-row a {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 9px 12px;
  font-size: 0.92rem;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease;
}

.site-nav a:hover,
.filter-row a:hover,
.tag-row a:hover,
.filter-row .is-active {
  background: var(--acid);
  transform: translateY(-2px);
}

.language-switcher {
  display: block;
}

.language-switcher select {
  width: auto;
  min-width: 132px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  padding: 9px 34px 9px 11px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
  cursor: pointer;
}

.hero-grid,
.section-band,
.page-intro,
.filter-row,
.specimen-grid,
.detail-layout,
.article-layout,
.guide-grid,
.message-page {
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 28px;
  min-height: min(760px, calc(100vh - 92px));
  align-items: center;
  padding-block: 34px 72px;
}

.hero-copy h1,
.page-intro h1,
.article-hero h1,
.detail-hero h1 {
  margin: 0;
  max-width: 980px;
  font-size: clamp(3rem, 7vw, 7.4rem);
  line-height: 0.9;
  font-weight: 950;
}

.hero-copy h1 {
  font-size: clamp(2.6rem, 5.4vw, 5.9rem);
  line-height: 1.04;
  text-wrap: balance;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede,
.page-intro p,
.detail-hero p,
.article-hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.45rem);
  line-height: 1.45;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 42px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
  padding: 10px 16px;
  font-weight: 900;
  box-shadow: 4px 4px 0 var(--red);
  cursor: pointer;
}

.button-muted {
  background: var(--white);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--cyan);
}

.type-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 20px;
  min-height: 520px;
  border: 2px solid var(--ink);
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(17, 17, 17, 0.055) 1px, transparent 1px),
    var(--white);
  background-size: 42px 42px;
  color: var(--ink);
  padding: clamp(20px, 3vw, 34px);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.type-stage::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(17, 17, 17, 0.22);
  pointer-events: none;
}

.proof-topline {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.proof-hero {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: end;
  min-height: 300px;
  padding: clamp(16px, 3vw, 30px);
}

.proof-watermark {
  position: absolute;
  inset: auto 0 -0.18em auto;
  color: rgba(17, 17, 17, 0.08);
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Noto Serif CJK KR", serif;
  font-size: clamp(14rem, 30vw, 25rem);
  font-weight: 950;
  line-height: 0.75;
  pointer-events: none;
}

.proof-title {
  position: relative;
  display: block;
  max-width: 620px;
  overflow-wrap: anywhere;
  font-size: clamp(2.25rem, 4.4vw, 4.9rem);
  font-weight: 950;
  line-height: 0.96;
  text-wrap: balance;
}

a.proof-title:hover {
  color: var(--cyan);
}

.proof-samples {
  position: relative;
  z-index: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(120px, 1fr);
  overflow-x: auto;
  border-top: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
  background: var(--paper);
}

.proof-samples-3,
.proof-samples-4 {
  grid-auto-columns: minmax(0, 1fr);
}

.proof-samples div {
  display: grid;
  align-content: space-between;
  gap: 18px;
  min-height: 140px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 14px;
}

.proof-samples span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.proof-samples strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(1.08rem, 1.6vw, 1.55rem);
  font-weight: 950;
  line-height: 1.18;
}

.proof-samples-3 strong,
.proof-samples-4 strong {
  font-size: clamp(0.98rem, 1.28vw, 1.36rem);
}

.section-band {
  padding-block: 70px;
}

.section-band-ink {
  max-width: none;
  margin-top: 30px;
  padding-inline: max(24px, calc((100vw - var(--max)) / 2 + 24px));
  background: var(--ink);
  color: var(--white);
}

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.98;
}

.specimen-grid,
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 16px;
}

.specimen-grid-wide,
.guide-grid-wide {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  padding-bottom: 80px;
}

.font-card,
.guide-card {
  display: grid;
  min-width: 0;
  min-height: 280px;
  grid-template-rows: auto auto 1fr;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  padding: 16px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.font-card:hover,
.guide-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--ink);
}

.font-card:nth-child(2n) {
  background: var(--lilac);
}

.font-card:nth-child(3n) {
  background: var(--cyan);
  color: var(--white);
}

.font-card:nth-child(4n) {
  background: var(--red);
}

.font-card-meta,
.guide-card span {
  align-self: start;
  max-width: 100%;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.font-card strong {
  align-self: center;
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  font-size: clamp(2.2rem, 5vw, 5rem);
  line-height: 0.92;
}

.font-card-large {
  min-height: 360px;
}

.specimen-grid:not(.specimen-grid-wide) .font-card strong {
  font-size: clamp(1.9rem, 3.4vw, 3.6rem);
}

.font-sample {
  align-self: end;
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 1.12rem;
  line-height: 1.35;
}

.guide-card {
  min-height: 320px;
  background: var(--paper);
}

.guide-card:nth-child(2n) {
  background: var(--acid);
}

.guide-card:nth-child(3n) {
  background: var(--white);
}

.guide-card h2,
.guide-card h3 {
  max-width: 100%;
  margin: 20px 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  font-size: clamp(1.45rem, 2vw, 2.25rem);
  line-height: 1.08;
}

.guide-card p {
  align-self: end;
  max-width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
  color: inherit;
  font-size: 1rem;
  line-height: 1.5;
}

.guide-grid:not(.guide-grid-wide) .guide-card h2,
.guide-grid:not(.guide-grid-wide) .guide-card h3 {
  font-size: clamp(1.35rem, 1.7vw, 2rem);
}

.page-intro {
  padding-block: 70px 24px;
}

.filter-row {
  padding-block: 0 32px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 22px;
  padding-block: 62px 86px;
}

.detail-hero,
.article-hero {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  padding: clamp(24px, 5vw, 54px);
}

.detail-hero h1 {
  margin-bottom: 24px;
}

.meta-panel {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--acid);
  padding: 20px;
  overflow-wrap: anywhere;
  height: fit-content;
  position: sticky;
  top: 18px;
}

.meta-panel dt {
  margin-top: 16px;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.meta-panel dd {
  margin: 4px 0 0;
  line-height: 1.4;
}

.sample-matrix {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.sample-matrix h2 {
  font-size: clamp(2rem, 5vw, 5.5rem);
  line-height: 0.95;
  margin: 18px 0 6px;
}

.sample-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
  border-top: 2px solid var(--ink);
  padding: 20px 0;
}

.sample-row span {
  font-weight: 950;
}

.sample-row p {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: clamp(2rem, 6vw, 6.5rem);
  line-height: 1.05;
}

.article-layout {
  padding-block: 60px 92px;
}

.article-hero {
  min-height: 380px;
}

.article-hero h1 {
  max-width: 1060px;
  overflow-wrap: anywhere;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  font-weight: 900;
}

.tag-row {
  margin: 18px 0;
}

.article-body {
  max-width: 820px;
  margin-top: 34px;
  font-size: clamp(1.1rem, 2vw, 1.32rem);
  line-height: 1.75;
}

.article-body p {
  margin: 0 0 1.2em;
}

.empty-state,
.message-page {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  padding: 24px;
}

.message-page {
  margin-top: 80px;
}

.message-page h1 {
  margin-top: 0;
  font-size: clamp(2rem, 5vw, 5rem);
  line-height: 1;
}

.admin-shell,
.auth-shell {
  min-height: 100vh;
  background: var(--paper);
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100vh;
  border-right: 2px solid var(--ink);
  background: var(--white);
  padding: 24px;
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav a {
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-weight: 900;
}

.admin-nav a[aria-current="page"] {
  background: var(--acid);
}

.admin-main {
  padding: 34px;
  overflow-x: auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-header h1,
.auth-panel h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.95;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
}

.admin-table {
  width: 100%;
  min-width: 820px;
  table-layout: fixed;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(17, 17, 17, 0.18);
  padding: 14px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.admin-table th {
  background: var(--ink);
  color: var(--white);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.admin-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.table-actions a,
.table-actions button {
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  padding: 7px 10px;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.table-actions form {
  margin: 0;
}

.editor-form,
.stacked-form {
  display: grid;
  gap: 18px;
}

.form-section,
.auth-panel {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  padding: 22px;
}

.form-section h2 {
  margin: 0 0 18px;
  font-size: 1.35rem;
}

.field-help {
  max-width: 760px;
  margin: -6px 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.field-help code {
  border: 1px solid rgba(17, 17, 17, 0.22);
  border-radius: 4px;
  background: var(--paper);
  padding: 2px 5px;
}

.webfont-actions {
  margin: 14px 0;
}

.webfont-preview {
  display: grid;
  gap: 8px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(17, 17, 17, 0.06) 1px, transparent 1px),
    linear-gradient(180deg, rgba(17, 17, 17, 0.06) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
  padding: 18px;
}

.webfont-preview span {
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.webfont-preview strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 1;
}

.code-preview {
  overflow-x: auto;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: #151515;
  color: #f8f8f2;
  padding: 14px;
  line-height: 1.45;
}

.translation-block {
  display: grid;
  gap: 12px;
  border-top: 2px solid var(--ink);
  padding-top: 18px;
  margin-top: 18px;
}

.translation-block h3 {
  margin: 0;
}

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

label {
  display: grid;
  gap: 7px;
}

label span {
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 11px 12px;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.toggle-row label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.toggle-row input {
  width: auto;
}

.auth-shell {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(440px, 100%);
  box-shadow: 8px 8px 0 var(--ink);
}

.auth-brand {
  margin-bottom: 28px;
}

.form-errors,
.form-success {
  border: 2px solid var(--red);
  border-radius: var(--radius);
  background: #fff5f0;
  padding: 10px 12px;
  margin: 14px 0;
  font-weight: 800;
}

.form-success {
  border-color: var(--cyan);
  background: #effffc;
}

@media (max-width: 960px) {
  .site-header,
  .hero-grid,
  .detail-layout,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .site-nav {
    justify-content: start;
  }

  .type-stage {
    min-height: 430px;
  }

  .proof-hero {
    min-height: 260px;
  }

  .proof-samples {
    grid-auto-columns: minmax(118px, 1fr);
  }

  .specimen-grid,
  .specimen-grid-wide,
  .guide-grid,
  .guide-grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  }

  .admin-sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }

  .admin-main {
    padding: 24px;
  }

  .meta-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding-inline: 16px;
  }

  .hero-grid,
  .section-band,
  .page-intro,
  .filter-row,
  .specimen-grid,
  .detail-layout,
  .article-layout,
  .guide-grid,
  .message-page {
    padding-inline: 16px;
  }

  .hero-grid {
    min-height: auto;
    padding-top: 22px;
  }

  .hero-copy h1,
  .page-intro h1,
  .article-hero h1,
  .detail-hero h1 {
    font-size: clamp(2.55rem, 14vw, 4.8rem);
  }

  .hero-copy h1 {
    font-size: clamp(2.25rem, 11vw, 4rem);
    line-height: 1.06;
  }

  .specimen-grid,
  .specimen-grid-wide,
  .guide-grid,
  .guide-grid-wide,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .font-card,
  .font-card-large,
  .guide-card {
    min-height: 250px;
  }

  .font-card strong,
  .specimen-grid:not(.specimen-grid-wide) .font-card strong {
    font-size: clamp(2rem, 14vw, 4rem);
  }

  .sample-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .sample-row p {
    font-size: clamp(2rem, 14vw, 4.6rem);
  }

  .type-stage {
    min-height: auto;
    padding: 18px;
  }

  .type-stage::before {
    inset: 12px;
  }

  .proof-hero {
    min-height: 220px;
    padding: 12px 0;
  }

  .proof-watermark {
    font-size: clamp(10rem, 48vw, 16rem);
  }

  .proof-title {
    font-size: clamp(2.2rem, 12vw, 4rem);
  }

  .proof-samples {
    grid-auto-columns: minmax(112px, 1fr);
  }

  .proof-samples-3,
  .proof-samples-4 {
    grid-auto-columns: minmax(96px, 1fr);
  }

  .proof-samples div {
    min-height: 88px;
    gap: 12px;
    padding: 10px;
  }

  .proof-samples-3 strong,
  .proof-samples-4 strong {
    font-size: clamp(0.86rem, 3.6vw, 1.05rem);
  }

  .admin-header {
    align-items: stretch;
    flex-direction: column;
  }
}
