:root {
  color-scheme: light;
  --paper: #f6f3ec;
  --card: #fffdf8;
  --ink: #252823;
  --subtle: #565c52;
  --green: #254c3d;
  --line: #d7d9ce;
  --serif: 'Noto Serif KR', 'AppleMyungjo', 'Nanum Myeongjo', Georgia, serif;
  --sans: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.7 var(--sans); }
a { color: var(--green); text-underline-offset: .22em; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #885418; outline-offset: 3px; }
img, video { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1,h2 { line-height: 1.24; word-break: keep-all; }
h1 { font-family: var(--serif); font-weight: 700; letter-spacing: -.05em; }
h2 { letter-spacing: -.025em; }
p { overflow-wrap: anywhere; }
.shell { width: min(calc(100% - 3rem), 1060px); margin-inline: auto; }
.sitebar { background: var(--card); border-bottom: 1px solid var(--line); }
.sitebar .shell { display: flex; justify-content: space-between; align-items: center; min-height: 68px; gap: 1rem; }
.brand { font-weight: 800; color: var(--ink); text-decoration: none; white-space: nowrap; }
nav { display: flex; gap: clamp(.7rem, 2.5vw, 1.7rem); }
nav a { font-size: .88rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
nav a:hover { text-decoration: underline; }
.skip { position: absolute; padding: .55rem .8rem; background: var(--card); clip-path: inset(50%); }
.skip:focus { clip-path: none; z-index: 10; }
.home { padding-block: clamp(2rem, 7vw, 5rem) 4rem; }
.home-header { margin-bottom: 2.1rem; }
.home h1 { font-size: clamp(3rem, 8vw, 5.8rem); }
.home-header p, .home-simulation p { margin-top: .8rem; color: var(--subtle); }
.posts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.15rem; }
.card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.card a { display: block; height: 100%; text-decoration: none; color: inherit; }
.card a:focus-visible { outline-offset: -4px; }
.card a:hover h2 { text-decoration: underline; text-underline-offset: .2em; }
.card img { width: 100%; height: clamp(220px, 28vw, 330px); object-fit: cover; object-position: center 64%; }
.card-copy { padding: clamp(1rem, 3vw, 1.6rem); }
.card-copy h2 { font-size: clamp(1.25rem, 3vw, 1.65rem); }
.card-copy p { color: var(--subtle); margin-top: .8rem; }
.home-simulation { display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; background: #e4ebe1; border: 1px solid #c8d5ca; border-radius: 12px; padding: 1.4rem; margin-top: 1.15rem; }
.button, button { display: inline-block; padding: .65rem .85rem; border-radius: 7px; background: var(--green); color: white; border: 1px solid var(--green); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.button { white-space: nowrap; }
.reading { max-width: 760px; width: calc(100% - 3rem); margin: 0 auto; padding: clamp(2.2rem, 6vw, 4.6rem) 0 4rem; }
.reading h1 { font-size: clamp(2.1rem, 5.8vw, 4rem); margin-bottom: 1.5rem; }
.reading h2 { margin-top: 2.45rem; margin-bottom: .7rem; font-size: clamp(1.35rem, 4vw, 1.7rem); }
.reading p, .reading li { font-size: 1.07rem; }
.reading p { margin-bottom: 1rem; }
.reading p:first-of-type strong:only-child { font-size: .9rem; }
.reading img { max-height: 680px; object-fit: contain; border-radius: 9px; margin-inline: auto; }
.reading figure { margin: 1.25rem 0; }
.reading video { width: 100%; background: #241f1a; border-radius: 9px; }
figcaption { color: var(--subtle); font-size: .88rem; margin-top: .45rem; }
.article-footer { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 2.8rem; }
.simulation { padding-block: 3rem 4rem; }
.simulation h1 { font-size: clamp(2.1rem, 6vw, 3.75rem); margin-bottom: .7rem; }
.simulation .intro { color: var(--subtle); margin-bottom: 1.65rem; }
.sim-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0,1.25fr) minmax(0,1fr); }
.sim-panel { padding: clamp(.9rem, 2vw, 1.25rem); border: 1px solid var(--line); border-radius: 12px; background: var(--card); min-width: 0; }
.sim-panel h2 { font-size: 1.15rem; margin-bottom: .8rem; }
canvas { width: 100%; height: auto; display: block; border-radius: 8px; background: #ecefe8; }
.scene-controls { display: grid; grid-template-columns: 1fr auto; gap: .7rem; align-items: end; margin-top: .85rem; }
.scene-controls label { display: grid; font-size: .88rem; }
.scene-controls button { background: var(--card); color: var(--green); }
.scene-controls button[aria-pressed=true] { background: var(--green); color: #fff; }
.scene-help, .limits { color: var(--subtle); font-size: .9rem; margin-top: .65rem; }
input { accent-color: var(--green); max-width: 100%; }
.dimensions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .55rem; }
.dimensions label { display: grid; font-size: .88rem; }
.dimensions input { border: 1px solid #aeb9ac; padding: .42rem .46rem; border-radius: 6px; background: white; color: var(--ink); font: inherit; }
table { width: 100%; border-collapse: collapse; margin-block: .8rem; text-align: left; font: .9rem/1.4 var(--sans); }
th, td { padding: .45rem .25rem; border-bottom: 1px solid var(--line); }
th { font-weight: 650; }
td[data-short=true] { color: #97372a; font-weight: 700; }
.results { min-height: 1.6em; color: var(--green); font-weight: 650; }
.results[data-invalid=true] { color: #97372a; }
.dock-compare { padding-top: 1rem; margin-top: 1.15rem; border-top: 1px solid var(--line); }
@media (max-width: 700px) {
  .shell, .reading { width: calc(100% - 2rem); }
  .posts, .sim-grid { grid-template-columns: 1fr; }
  .home-simulation { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 390px) {
  .brand { font-size: .9rem; }
  nav a { font-size: .78rem; }
  .scene-controls { grid-template-columns: 1fr; }
  .scene-controls button { justify-self: start; }
}
