:root {
  color-scheme: dark;
  --bg: #0d0c0c;
  --surface: #191718;
  --text: #f3eee5;
  --muted: #b4aaa2;
  --gold: #d1b479;
  --line: #443b31;
  --serif: "Noto Serif TC", "Songti TC", "Noto Serif CJK TC", "PMingLiU", "MingLiU", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.6; }
body, button, input { -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
a { color: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #f0d198; outline-offset: 5px; }
::selection { color: #171310; background: #e2c38a; }
.wrap { width: min(84.5%, 77rem); margin-inline: auto; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon { display: block; flex: none; width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }

/* Brand and navigation */
[data-site-header] { position: relative; z-index: 1; background: #100f10; border-bottom: 1px solid #302a26; }
.header-inner { min-height: 4.9rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand img { width: 2.8rem; height: 2.8rem; object-fit: contain; }
.brand-words { display: grid; gap: .17rem; }
.brand-words b { font: 700 1.45rem/1.15 var(--serif); letter-spacing: .13em; }
.brand-words > span { color: var(--gold); font: 600 .59rem/1.1 Georgia, serif; letter-spacing: .21em; }
.site-nav { display: flex; align-items: center; gap: 2.25rem; align-self: stretch; }
.site-nav a { position: relative; display: flex; align-items: center; gap: .5rem; color: #c6bfb5; font-size: .91rem; letter-spacing: .07em; text-decoration: none; }
.site-nav .icon { width: 1.05rem; height: 1.05rem; }
.site-nav a[aria-current], .site-nav a:hover { color: #e4c88f; }
.site-nav a[aria-current]::after { content: ""; height: 2px; background: var(--gold); position: absolute; inset: auto 0 -1px; }

/* Classroom entrance */
.hero { position: relative; isolation: isolate; overflow: hidden; display: grid; align-items: center; min-height: clamp(31rem, 41vw, 38rem); background: #090808; }
.hero-art { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-art img { display: block; position: absolute; right: 3%; top: 0; width: min(96%, 84rem); height: 100%; object-fit: contain; object-position: right center; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #0c0a0b 0%, rgba(13,10,12,.9) 27%, rgba(13,10,12,.12) 55%, transparent 72%, rgba(10,8,9,.13) 94%, #090808 100%), linear-gradient(0deg, rgba(11,8,9,.75), transparent 13%, transparent 90%, rgba(11,8,9,.22)); }
.hero-inner { padding-block: 3.8rem 4.25rem; }
.hero-copy { position: relative; width: min(100%, 32rem); }
.eyebrow { display: flex; align-items: center; gap: .72rem; color: var(--gold); font: 500 .75rem/1.3 Georgia, "Times New Roman", serif; letter-spacing: .19em; text-transform: uppercase; }
.star { display: block; width: .95rem; height: .95rem; flex: none; background: var(--gold); clip-path: polygon(50% 0,60% 38%,100% 50%,60% 60%,50% 100%,39% 60%,0 50%,39% 39%); }
.hero-eyebrow { margin-bottom: 1.25rem; }
.hero h1 { margin: 0; color: #f3ede1; font-family: var(--serif); font-size: clamp(3.2rem, 5.45vw, 5.3rem); letter-spacing: .065em; font-weight: 700; line-height: 1.2; }
.hero h1 span { color: #e4c991; }
.hero-intro { margin: 1.05rem 0 0; color: #cdc3b7; font-size: 1.01rem; line-height: 1.8; letter-spacing: .07em; }
.code-form { position: relative; max-width: 29.6rem; margin-top: 2.05rem; padding: 1.25rem 1.4rem 1.03rem; border: 1px solid #514437; border-radius: 3px; background: linear-gradient(115deg, rgba(40,33,31,.81), rgba(25,22,21,.88)); box-shadow: 0 12px 40px #0003; }
.code-form::before, .code-form::after { content: ""; position: absolute; width: .55rem; height: .55rem; pointer-events: none; border-style: solid; border-color: #bba075; }
.code-form::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; border-radius: 3px 0 0; }
.code-form::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; border-radius: 0 0 3px; }
.form-heading, .form-heading label, .form-controls, .form-controls button { display: flex; align-items: center; }
.form-heading { justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.form-heading label { gap: .6rem; font-size: 1rem; font-weight: 600; color: #efdfc6; letter-spacing: .09em; }
.form-heading .icon { color: var(--gold); }
.form-caption { color: #b6a487; font: .67rem/1.3 Georgia, serif; letter-spacing: .16em; text-transform: uppercase; }
.form-controls { gap: .6rem; }
.form-controls input { display: block; width: 0; min-width: 0; flex: 1; height: 3.05rem; border: 1px solid #584c42; border-radius: 2px; padding: .5rem .9rem; color: var(--text); background: #100f10; letter-spacing: .04em; }
.form-controls input::placeholder { color: #aaa098; }
.form-controls input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.form-controls input[aria-invalid="true"] { border-color: #e69b95; }
.form-controls button { justify-content: center; gap: .48rem; flex: none; min-height: 3.05rem; padding: .5rem 1.13rem; border: 1px solid #e4c68d; border-radius: 2px; background: linear-gradient(105deg, #ebd3a1, #ddbd82); color: #2c2319; font-size: .97rem; font-weight: 700; letter-spacing: .06em; cursor: pointer; }
.form-controls button:hover { background: #f2daaa; }
.form-controls button:active { transform: translateY(1px); }
.input-hint, .form-status { margin: .65rem 0 0; font-size: .81rem; letter-spacing: .04em; line-height: 1.5; }
.input-hint { color: #b1a69a; }
.form-status { color: #f0ada2; }
.form-status:empty { display: none; }
.code-form:has(.form-status:not(:empty)) .input-hint { display: none; }

/* Contact and copyright */
.contact-area { position: relative; border-block: 1px solid #3c332d; background: #151315; }
.contact-area:focus { outline: none; }
.seam { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); display: flex; align-items: center; gap: .3rem; color: var(--gold); }
.seam::before, .seam::after { content: ""; width: .24rem; height: .24rem; background: #937951; transform: rotate(45deg); }
.seam .star { width: .86rem; height: .86rem; }
.contact-inner { display: grid; grid-template-columns: minmax(16rem, .93fr) minmax(0, 1.83fr); gap: 2.75rem; align-items: center; padding-block: clamp(2.2rem, 4vw, 3.3rem); }
.contact-eyebrow { font-size: .68rem; letter-spacing: .2em; }
.contact-eyebrow::before { content: ""; width: 1.6rem; height: 1px; background: #a88d61; }
.contact-intro h2 { margin: .55rem 0 .3rem; font: 650 clamp(1.55rem, 2.3vw, 2.08rem)/1.4 var(--serif); letter-spacing: .06em; }
.contact-intro p { margin: 0; color: var(--muted); font-size: .925rem; letter-spacing: .03em; }
.social-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.social-card { --surface: #1c191a; display: flex; align-items: center; gap: .85rem; min-height: 5rem; padding: .85rem clamp(.75rem, 1.4vw, 1.3rem); border: 1px solid #423a35; border-radius: 3px; background: var(--surface); text-decoration: none; transition: border-color .2s, background-color .2s; }
.social-card:hover { --surface: #241f1e; border-color: #9c8059; }
.social-icon { color: #d2b780; }
.social-icon .icon { width: 1.75rem; height: 1.75rem; }
.social-words { display: grid; gap: .2rem; }
.social-words strong { font-family: Georgia, var(--serif); font-weight: 500; font-size: 1.1rem; line-height: 1.4; }
.social-words small { color: var(--muted); font-size: .77rem; letter-spacing: .025em; }
.copyright { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 1.55rem; color: #aaa197; font-size: .76rem; letter-spacing: .045em; }
.copyright [lang] { font-family: Georgia, serif; letter-spacing: .08em; }
.suits { position: absolute; left: 50%; transform: translateX(-50%); color: #b8a280; font: 1.02rem/1 Georgia, serif; word-spacing: .38rem; }
.suits b { font-weight: 400; color: #a46667; }

@media (min-width: 1600px) {
  .hero-art img { right: calc((100% - 91rem) / 2); }
}
@media (max-width: 1100px) {
  .wrap { width: 89%; }
  .contact-inner { gap: 1.4rem; grid-template-columns: minmax(14rem, .75fr) minmax(0, 1.8fr); }
  .social-card { gap: .65rem; }
}
@media (max-width: 850px) {
  .contact-inner { grid-template-columns: 1fr; gap: 1.35rem; }
  .hero-art img { right: -5%; max-width: none; }
  .hero-art::after { background: linear-gradient(90deg, #0b090a, rgba(11,9,10,.91) 36%, transparent 75%), linear-gradient(0deg, #0b090a, transparent 14%); }
  .hero-copy { width: 28rem; }
}
@media (max-width: 680px) {
  .wrap { width: calc(100% - 2.5rem); }
  .header-inner { min-height: 4.2rem; gap: .6rem; }
  .brand { gap: .45rem; }
  .brand img { width: 2.3rem; height: 2.3rem; }
  .brand-words b { font-size: 1.15rem; }
  .brand-words > span { font-size: .52rem; }
  .site-nav { gap: 1.05rem; }
  .site-nav a { gap: .33rem; font-size: .83rem; }
  .site-nav .icon { width: .9rem; height: .9rem; }
  .hero { align-items: end; min-height: 0; }
  .hero-art { bottom: auto; height: clamp(15.5rem, 57vw, 22rem); }
  .hero-art img { right: 0; width: 100%; height: 100%; object-fit: cover; object-position: right 34%; }
  .hero-art::after { background: linear-gradient(0deg, #090808 1%, rgba(9,8,8,.74) 15%, transparent 52%), linear-gradient(90deg, rgba(9,8,8,.78), transparent 65%); }
  .hero-inner { padding-block: clamp(10.25rem, 40vw, 15rem) 2.5rem; }
  .hero-copy { width: min(100%, 32rem); }
  .hero-eyebrow { margin-bottom: .7rem; font-size: .66rem; gap: .55rem; }
  .hero h1 { font-size: clamp(2.8rem, 9.5vw, 3.8rem); }
  .hero-intro { margin-top: .75rem; font-size: .95rem; letter-spacing: .035em; }
  .code-form { margin-top: 1.4rem; max-width: none; padding: 1.05rem; }
  .form-controls input { padding-inline: .7rem; }
  .form-controls button { padding-inline: .78rem; }
  .contact-inner { padding-block: 2.2rem; }
  .social-links { gap: .55rem; }
  .social-card { flex-direction: column; justify-content: center; gap: .55rem; padding: .85rem .25rem; text-align: center; }
  .social-icon .icon { width: 1.5rem; height: 1.5rem; }
  .social-words { gap: .16rem; }
  .social-words strong { font-size: .99rem; }
  .social-words small { font-size: .72rem; }
  .copyright { flex-direction: column; align-items: flex-start; gap: .35rem; padding-block: 1.25rem; }
  .suits { left: auto; right: 0; top: 1.45rem; transform: none; font-size: .85rem; word-spacing: .12rem; }
}
@media (max-width: 365px) {
  .site-nav .icon, .social-words small { display: none; }
  .form-controls button { gap: .28rem; padding-inline: .55rem; }
  .form-caption { font-size: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
}
