/* Hangulish site — simple, elegant. Cream paper, ink, and the mascot colors used sparingly. */
@font-face { font-family: 'Hangulish'; src: url('../fonts/hangulish-glyph.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'AHOS Hangulish'; font-weight: 400; src: url('../fonts/ahos-hangulish-regular.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'AHOS Hangulish'; font-weight: 700; src: url('../fonts/ahos-hangulish-bold.woff2') format('woff2'); font-display: swap; }
.hg-font { font-family: 'AHOS Hangulish', system-ui, sans-serif; font-weight: 700; letter-spacing: .01em; line-height: 1.15; white-space: nowrap; }
@font-face { font-family: 'HGDisplay'; src: url('../fonts/hangulish-display.woff2') format('woff2'); font-display: swap; }

:root {
  --bg: #faf7f1; --panel: #ffffff; --panel2: #f2ede2; --ink: #17140f; --muted: #6b665d;
  --line: #e4ddcf; --red: #d8352a; --blue: #1f63b5; --green: #2e7d4f;
  --accent: var(--red); --text: var(--ink); --border: var(--line);
  --wrap: 1080px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.7; font-size: 17px; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* language toggle: both languages live in the page, one is shown */
body[data-lang="en"] .ko { display: none !important; }
body[data-lang="ko"] .en { display: none !important; }

/* Korean: never break inside a word; no wide tracking */
.ko { word-break: keep-all; overflow-wrap: break-word; }
.kicker .ko, .kicker.ko, .card-title .ko, .label .ko { letter-spacing: .02em; text-transform: none; }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(250,247,241,.985); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { font-family: 'HGDisplay', system-ui, sans-serif; font-size: 22px; letter-spacing: .06em; text-decoration: none; color: var(--ink); }
.brand sup { font-size: .45em; margin-left: 2px; color: var(--muted); }
.site-nav { display: flex; gap: 22px; margin-left: auto; font-size: 15px; }
.site-nav a { white-space: nowrap; text-decoration: none; color: var(--muted); padding: 6px 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a.active { color: var(--ink); border-bottom-color: var(--accent); }
.lang-toggle { margin-left: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--ink); }
.lang-toggle:hover { border-color: var(--accent); }
@media (max-width: 760px) {
  .site-header .wrap { height: auto; flex-wrap: wrap; padding: 10px 20px; gap: 6px 16px; }
  .site-nav { order: 3; width: 100%; margin-left: 0; gap: 16px; overflow-x: auto; }
  .lang-toggle { margin-left: auto; }
}

/* typography */
.display { font-family: 'HGDisplay', system-ui, sans-serif; font-weight: 400; line-height: 1.12; letter-spacing: .01em; }
h1.display { font-size: clamp(44px, 9vw, 104px); margin: 0 0 24px; }
h2 { font-family: 'HGDisplay', system-ui, sans-serif; font-weight: 400; font-size: clamp(30px, 4.6vw, 46px); line-height: 1.2; margin: 0 0 18px; }
h3 { font-size: 20px; margin: 28px 0 8px; }
p { margin: 0 0 18px; }
.kicker { font-size: 13px; letter-spacing: .22em; color: var(--muted); text-transform: uppercase; margin: 0 0 22px; }
.lead { font-size: clamp(18px, 2.2vw, 22px); max-width: 720px; color: #2c2822; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
section { padding: 72px 0; }
section + section { border-top: 1px solid var(--line); }
.hero { padding: 96px 0 72px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.btn { display: inline-block; padding: 13px 22px; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none; font-size: 15px; border: 1px solid var(--ink); }
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { color: #fff; }

/* hero glyph */
.hero-glyph { margin-top: 48px; font-family: 'AHOS Hangulish', system-ui, sans-serif; font-size: clamp(56px, 12vw, 120px); font-weight: 700; color: var(--accent); display: flex; flex-wrap: wrap; gap: .14em; align-items: center; min-height: 1.2em; }
.caption { font-size: 14px; color: var(--muted); margin-top: 12px; }

/* grids and cards */
.two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; gap: 28px; } }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-top: 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px 24px; text-decoration: none; transition: border-color .2s, transform .2s; display: block; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card .card-title { font-family: 'HGDisplay', system-ui, sans-serif; font-size: 26px; margin: 0 0 6px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
figure { margin: 0; }
figure img { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; }

/* pull quote */
.pull { font-family: 'HGDisplay', system-ui, sans-serif; font-size: clamp(26px, 4vw, 40px); line-height: 1.3; max-width: 880px; margin: 0; }
.pull small { display: block; font-family: system-ui, sans-serif; font-size: 14px; color: var(--muted); margin-top: 14px; letter-spacing: .04em; }
.quote-band { background: var(--ink); color: #fff; border: 0 !important; }
.quote-band .pull small { color: #b8b2a6; }
.quote-band + section { border-top: 0; }

/* concept strip */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 270px); gap: 14px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; }
.strip figure { scroll-snap-align: start; }
.strip img { aspect-ratio: 4/5; object-fit: cover; width: 100%; }

/* rule diagram */
.rule { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.rule-row { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 18px 22px; align-items: center; border-top: 1px solid var(--line); }
.rule-row:first-child { border-top: 0; }
.rule-row b { font-family: 'HGDisplay', system-ui, sans-serif; font-size: 22px; font-weight: 400; }
.tag { display: inline-block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; margin-left: 8px; vertical-align: middle; color: #fff; }
.tag.latin { background: var(--blue); } .tag.hangul { background: var(--red); }
.examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.example { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; text-align: center; }
.example .glyph { font-family: 'AHOS Hangulish', sans-serif; font-size: 44px; font-weight: 700; color: var(--accent); display: flex; justify-content: center; flex-wrap: wrap; gap: .14em; min-height: 1.3em; align-items: center; }
.example .label { margin-top: 12px; font-size: 14px; color: var(--muted); letter-spacing: .08em; }
.vowels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 16px; max-width: 640px; }
.vowels div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; text-align: center; padding: 14px 4px 10px; }
.vowels b { display: block; font-family: 'HGDisplay', "Apple SD Gothic Neo", sans-serif; font-size: 34px; font-weight: 400; color: var(--red); line-height: 1.1; }
.vowels span { font-size: 13px; color: var(--muted); letter-spacing: .08em; }
.timeline { display: grid; gap: 0; margin-top: 12px; }
.timeline div { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.timeline div:first-child { border-top: 0; }
.timeline b { font-weight: 600; }
@media (max-width: 640px) { .rule-row, .timeline div { grid-template-columns: 1fr; gap: 4px; } }

/* name card (ported) */
.tryit-input { width: 100%; padding: 16px 18px; font-size: 22px; border-radius: 12px; border: 2px solid var(--border); background: var(--panel); color: var(--ink); font-family: inherit; text-transform: uppercase; }
.tryit-input:focus { outline: none; border-color: var(--accent); }
.accent-picker { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; min-height: 34px; }
.accent-picker button { padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border); background: var(--panel2); color: var(--muted); font-size: 13px; cursor: pointer; }
.accent-picker button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.name-card { position: relative; background: linear-gradient(160deg, #ffffff, var(--panel2)); border: 1px solid var(--border); border-radius: 6px; padding: 52px 32px 44px; text-align: center; margin-top: 24px; box-shadow: 0 24px 60px rgba(0,0,0,0.09); }
.name-card .seal { position: absolute; top: 20px; right: 20px; width: 34px; height: 34px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; border-radius: 2px; transform: rotate(-4deg); box-shadow: 0 3px 10px rgba(216,53,42,0.35); }
.name-card .original { font-size: 13px; color: var(--muted); letter-spacing: 0.1em; margin-bottom: 16px; }
.hanglish-glyph { font-family: 'AHOS Hangulish', -apple-system, sans-serif; font-size: clamp(40px, 8.5vw, 72px); font-weight: 700; color: var(--accent); margin-bottom: 22px; min-height: 1.15em; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.14em; }
.name-card .divider { width: 48px; height: 2px; background: var(--border); margin: 0 auto 20px; }
.name-card .row { font-size: 15px; color: var(--muted); margin-bottom: 6px; }
.name-card .row b { color: var(--ink); font-weight: 700; }
.name-card .watermark { font-family: 'HGDisplay', sans-serif; margin-top: 24px; font-size: 13px; letter-spacing: 0.3em; color: var(--accent); }
.name-card.not-found .hanglish-glyph { font-size: 22px; color: var(--muted); font-weight: 600; letter-spacing: 0; font-family: system-ui, sans-serif; }
.pills { margin-top: 16px; font-size: 14px; color: var(--muted); }
.pill { display: inline-block; background: var(--panel2); border: 1px solid var(--border); border-radius: 14px; padding: 3px 11px; margin: 3px 2px; font-size: 12.5px; cursor: pointer; }
.pill:hover { border-color: var(--accent); color: var(--accent); }
.note { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; color: #3a352d; font-size: 15px; margin-top: 28px; }

/* glyph construction (ported from the Hangulish engine) */
.syl { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; width: 1.15em; height: 1.15em; aspect-ratio: 1 / 1; box-sizing: border-box; padding: 0.06em; flex-shrink: 0; overflow: visible; }
.syl::after { content: ""; position: absolute; inset: 0; border: max(1.4px, 0.02em) solid currentColor; border-radius: 0.1em; opacity: 0.22; pointer-events: none; }
.syl-box { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; max-width: 100%; max-height: 100%; }
.syl-top { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; }
.syl-beside-row { display: inline-flex; align-items: center; justify-content: center; gap: 0em; line-height: 1; }
.syl-letter, .syl-vowel, .syl-below-cons, .syl-below-vowel, .syl-batchim { font-size: 1em; line-height: 1; display: inline-block; transform-origin: center; text-align: center; }
.syl[data-below="1"][data-has-batchim="1"] .syl-below-cons { display: block; transform: scale(1.68, 0.85); transform-origin: center bottom; margin-bottom: 0.01em; line-height: 0.90; }
.syl[data-below="1"][data-has-batchim="1"] .syl-below-vowel { display: block; margin: 0.01em 0; transform: scale(1.45, 0.80); transform-origin: center; line-height: 0.7; }
.syl[data-below="1"][data-has-batchim="1"] .syl-batchim { transform: scale(1.68, 0.85); transform-origin: center top; margin-top: 0.01em; padding-top: 0; border-top: none; line-height: 0.90; }
.syl-below-cons { display: block; margin-bottom: 0.01em; transform: scale(1.50, 0.88); }
.syl-below-vowel { display: block; margin: 0.01em 0; transform: scale(1.35, 0.85); }
.syl-batchim { display: block; margin-top: 0.02em; padding-top: 0; opacity: 1; border-top: none; text-align: center; transform: scale(1.50, 0.88); }
.syl .syl-beside-row .syl-letter { margin-right: -0.04em; }
.syl .syl-beside-row .syl-vowel { margin-left: -0.04em; }
.syl[data-variant="v3"] .syl-top { transform: translateY(-0.01em); }
.syl[data-variant="v3"] .syl-batchim { transform: translateY(-0.01em); }

/* gallery */
.gallery { columns: 3 280px; column-gap: 18px; }
.gallery figure { break-inside: avoid; margin: 0 0 18px; }
.gallery a { display: block; cursor: zoom-in; }
.gallery img { width: 100%; }
.lightbox { position: fixed; inset: 0; background: rgba(23,20,15,.92); display: none; align-items: center; justify-content: center; z-index: 50; padding: 24px; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 92vh; max-width: 92vw; background: #fff; border-radius: 8px; }

/* essay */
.essay { max-width: 720px; }
.essay p { font-size: 18px; }
.essay .figure-ink { margin: 8px 0 36px; max-width: 360px; }
.essay h3 { font-family: 'HGDisplay', system-ui, sans-serif; font-weight: 400; font-size: 26px; margin-top: 40px; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--muted); font-size: 14px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }

/* ---- v2: 스타일 고르기 ---- */
@font-face { font-family: 'AHOS Hangulish Light'; font-weight: 300; src: url('../fonts/ahos-hangulish-light.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'AHOS Hangulish Round'; font-weight: 400; src: url('../fonts/ahos-hangulish-round.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'AHOS Hangulish Buri'; font-weight: 400; src: url('../fonts/ahos-hangulish-buri.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'AHOS Hangulish Hand'; font-weight: 400; src: url('../fonts/ahos-hangulish-hand.woff2') format('woff2'); font-display: swap; }

.hg-font, .hero-glyph, .hanglish-glyph, .example .glyph { font-family: var(--hg-font, 'AHOS Hangulish'), system-ui, sans-serif; font-weight: var(--hg-weight, 700); }
.hg-style-picker { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.hg-style-picker button { font: inherit; font-size: 14px; display: inline-flex; align-items: baseline; gap: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 999px; padding: 7px 14px 7px 12px; cursor: pointer; }
.hg-style-picker button:hover { border-color: var(--accent); }
.hg-style-picker button.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.hg-style-picker button .sample { font-size: 20px; line-height: 1; }
.style-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 26px; }
.style-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 10px; }
.style-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.style-card .big { font-size: clamp(44px, 7vw, 64px); line-height: 1.25; color: var(--accent); min-height: 1.3em; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.style-card .name { font-weight: 700; letter-spacing: .02em; }
.style-card .desc { color: var(--muted); font-size: 14px; flex: 1; }
.style-card .use { align-self: flex-start; font: inherit; font-size: 14px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; }
.style-card .use:hover, .style-card.active .use { background: var(--ink); color: #fff; }
.style-note { color: var(--muted); font-size: 13px; margin-top: 22px; }
.site-nav { scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
@media (max-width: 720px) { .site-nav { font-size: 14px; } }
.engineering{background:#211916;color:#f4efe7;padding:100px 0}.engineering-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:70px;align-items:center}.engineering h2{font:400 clamp(42px,5.5vw,70px)/1.02 Georgia,serif;letter-spacing:-.04em;margin:14px 0 24px}.engineering-lead{max-width:570px;color:#d6ccc3;font-size:18px}.engineering-mark{display:flex;align-items:center;gap:14px;margin-top:34px}.mark-glyph{font-family:"AHOS Hangulish",serif;color:#f0b5a7;font-size:56px}.mark-line{height:1px;width:46px;background:#bd3f2b}.engineering-mark strong{display:block;font-size:14px;letter-spacing:.08em;text-transform:uppercase}.engineering-mark small{display:block;color:#bfb3aa;font-size:12px}.engineering-spec{border:1px solid rgba(240,181,167,.4);padding:24px;min-height:330px;display:flex;flex-direction:column;justify-content:space-between}.spec-top{display:flex;justify-content:space-between;color:#f0b5a7;font-size:9px;letter-spacing:.14em}.spec-glyph{font-family:"AHOS Hangulish",serif;font-size:clamp(90px,13vw,170px);line-height:.9;color:#f4efe7}.spec-copy{font-size:12px;letter-spacing:.18em;text-transform:uppercase;color:#f0b5a7}.engineering-spec p{font-size:12px;color:#c6bdb4;max-width:34ch}@media(max-width:760px){.engineering-grid{grid-template-columns:1fr}}
/* Final layout guard: prevent grid children, canvases, and long names from forcing overlap. */
*,*::before,*::after{box-sizing:border-box}
html,body{max-width:100%;overflow-x:hidden}
main>section,.wrap,.bridge,.bridge-copy,.bridge-art,.name-experience,.name-triad,.share-card,.type-lab-grid,.type-lab-copy,.type-specimen,.archive-grid,.archive-card,.works-grid,.works-grid figure,.goods-grid,.goods-card,.engineering-grid,.engineering-spec,.institute-grid,.mark-figure{min-width:0}
img,svg,canvas,video{max-width:100%}
#your-name .triad-item,#your-name .triad-item>*{min-width:0;max-width:100%}
#your-name .triad-item .original,#your-name .triad-item .hangulish,#your-name .triad-item .hangul{overflow-wrap:anywhere;word-break:break-word}
#your-name .glyph-run{width:100%;height:auto;display:block}
.hero-copy,.hero p,.type-lab-copy p,.engineering-lead,.archive-card p{min-width:0;overflow-wrap:anywhere}
.glyph-run{display:block;max-width:100%;height:auto}
.glyph-run{display:block;width:100%;max-width:100%;height:auto}
