/* ABC Translation Taiwan
   Palette: paper, ink, cinnabar seal (the red of a Taiwanese chop), jade.
   One bold element: the seal. Everything else stays quiet. */

:root {
  --paper: #f6f7f5;
  --paper-2: #eceeea;
  --white: #ffffff;
  --ink: #1c2a3f;
  --ink-2: #4a5566;
  --ink-3: #6b7482;
  --seal: #b3261e;
  --seal-dark: #8f1d17;
  --jade: #2d5f52;
  --rule: #d6dbd6;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif TC", "Noto Serif CJK TC", "Source Han Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei", sans-serif;
  --wrap: 72rem;
  --gap: clamp(1rem, 3vw, 2rem);
  --radius: 4px;
}
.lang-zh {
  --serif: "Noto Serif TC", "Noto Serif CJK TC", "Source Han Serif TC", "Songti TC", "PMingLiU", "Iowan Old Style", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}
.lang-zh body, body.lang-zh { line-height: 1.8; letter-spacing: .01em; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--jade); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--seal); }
:focus-visible { outline: 3px solid var(--seal); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0 0 .6em; color: var(--ink); }
h1 { font-size: clamp(2rem, 1.2rem + 3.2vw, 3.3rem); letter-spacing: -.01em; text-wrap: balance; }
h2, h3 { text-wrap: balance; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.1vw, 1.85rem); }
h3 { font-size: 1.15rem; }
.lang-zh h1 { letter-spacing: .02em; line-height: 1.3; word-break: keep-all; overflow-wrap: anywhere; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 48rem; }
.lead { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); color: var(--ink-2); max-width: 44em; }
.lang-zh .lead { max-width: 34em; }
.sec-lead { color: var(--ink-2); max-width: 44em; }
.note { color: var(--ink-3); font-size: .95rem; border-left: 3px solid var(--seal); padding-left: .9rem; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 1rem/1.2 var(--sans); padding: .85rem 1.4rem; border-radius: var(--radius);
  text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-seal { background: var(--seal); color: #fff; }
.btn-seal:hover { background: var(--seal-dark); color: #fff; }
.btn-line { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--ink); color: #fff; }
.btn-sm { padding: .55rem 1rem; font-size: .95rem; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- header ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.logo { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; }
.logo:hover { color: var(--ink); }
.logo-text { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; line-height: 1.05; display: flex; flex-direction: column; }
.logo-text small { font-family: var(--sans); font-weight: 500; font-size: .72rem; color: var(--ink-3); letter-spacing: .04em; margin-top: .15rem; }
.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.site-nav ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav ul a { color: var(--ink); text-decoration: none; font-weight: 500; padding: .35rem 0; border-bottom: 2px solid transparent; }
.site-nav ul a:hover, .site-nav ul a[aria-current="page"] { border-bottom-color: var(--seal); color: var(--ink); }
.lang-switch { font-weight: 600; color: var(--ink); text-decoration: none; border: 1px solid var(--rule); border-radius: var(--radius); padding: .3rem .6rem; font-size: .9rem; }
.lang-switch:hover { border-color: var(--ink); color: var(--ink); }
.nav-toggle { display: none; }

@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: .5rem; background: none; border: 1px solid var(--rule);
    border-radius: var(--radius); padding: .5rem .8rem; font: 600 .95rem var(--sans); color: var(--ink); cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 18px; height: 2px; background: var(--ink); position: relative; content: "";
  }
  .nav-toggle-bars::before { position: absolute; top: -6px; }
  .nav-toggle-bars::after { position: absolute; top: 6px; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--white);
    border-bottom: 1px solid var(--rule); flex-direction: column; align-items: stretch; padding: 1rem 1.25rem 1.5rem; gap: 1rem;
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { display: block; padding: .75rem 0; border-bottom: 1px solid var(--paper-2); }
  .lang-switch { align-self: flex-start; }
}

/* ---------- breadcrumbs ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .5rem; padding: 1.25rem 0 0; margin: 0; font-size: .9rem; color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--rule); }
.crumbs a { color: var(--ink-2); }

/* ---------- hero ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { max-width: 16em; }
.lang-zh .hero h1 { max-width: 12em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 1.25rem; }
.hero-note { color: var(--ink-3); font-size: .95rem; max-width: 36em; }

/* the document & seals — the page's signature element */
.hero-art { position: relative; aspect-ratio: 4 / 4.4; max-width: 25rem; justify-self: center; width: 100%; }
.sheet {
  position: absolute; background: var(--white); border: 1px solid var(--rule);
  box-shadow: 0 1px 0 var(--rule), 0 18px 40px -24px rgba(28, 42, 63, .45);
  padding: 9% 9%; display: flex; flex-direction: column; gap: 5%;
}
.sheet-back { inset: 0 18% 14% 0; transform: rotate(-4deg); background: var(--paper-2); }
.sheet-front { inset: 10% 0 0 16%; transform: rotate(1.5deg); }
.sheet-title { font-family: var(--serif); font-weight: 700; font-size: clamp(.9rem, .7rem + .5vw, 1.1rem); color: var(--ink); border-bottom: 1px solid var(--rule); padding-bottom: .5rem; }
.ln { display: block; height: 6px; border-radius: 3px; background: var(--paper-2); }
.sheet-back .ln { background: #dde1dc; }
.w40 { width: 40%; } .w50 { width: 50%; } .w60 { width: 60%; } .w70 { width: 70%; }
.w80 { width: 80%; } .w85 { width: 85%; } .w90 { width: 90%; } .w95 { width: 95%; }
.sign { margin-top: auto; width: 45%; height: 2.2rem; border-bottom: 1px solid var(--ink-3);
  background: no-repeat left 60% / 100% 70% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 30'%3E%3Cpath d='M3 22c10-14 16-18 18-12s-6 12 2 8 12-16 16-10-2 12 6 8 10-10 16-6 8 6 18 2' fill='none' stroke='%231c2a3f' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E"); }
.stamp {
  position: absolute; display: grid; place-items: center; color: var(--seal);
  font-family: "Noto Serif TC", "Noto Serif CJK TC", "Songti TC", "PMingLiU", var(--serif); font-weight: 700;
  mix-blend-mode: multiply; opacity: .92;
}
.stamp-sq {
  right: 9%; bottom: 8%; width: 30%; aspect-ratio: 1; border: 3px solid var(--seal); border-radius: 3px;
  outline: 1px solid var(--seal); outline-offset: -8px; font-size: clamp(1.35rem, .9rem + 1.5vw, 2.05rem);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; transform: rotate(-6deg);
  animation: press 0.55s cubic-bezier(.2, .9, .3, 1.2) .5s both;
}
.stamp-round {
  right: 36%; bottom: 14%; width: 24%; aspect-ratio: 1; border: 2px solid var(--seal); border-radius: 50%;
  font-size: clamp(.75rem, .6rem + .6vw, 1rem); transform: rotate(8deg); opacity: .78;
  animation: press2 0.55s cubic-bezier(.2, .9, .3, 1.2) 1.1s both;
}
.stamp-round::before { content: ""; position: absolute; inset: 5px; border: 1px dashed var(--seal); border-radius: 50%; }
@keyframes press { from { transform: rotate(-6deg) scale(1.6); opacity: 0; } to { transform: rotate(-6deg) scale(1); opacity: .92; } }
@keyframes press2 { from { transform: rotate(8deg) scale(1.6); opacity: 0; } to { transform: rotate(8deg) scale(1); opacity: .78; } }
@media (prefers-reduced-motion: reduce) { .stamp { animation: none !important; } }

/* ---------- legalization chain ---------- */
.chain-sec { background: var(--ink); color: #e8ebef; padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.chain-sec h2 { color: #fff; }
.chain-sec .sec-lead { color: #c3cad4; }
.chain { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; padding: 0; margin: 2.25rem 0 1.5rem; position: relative; }
.chain::before { content: ""; position: absolute; left: 1.25rem; right: 1.25rem; top: 1.25rem; height: 1px; background: #4a5a72; }
.chain li { counter-increment: step; position: relative; padding-top: 3.5rem; }
.chain li::before {
  content: counter(step); position: absolute; top: 0; left: 0; width: 2.5rem; height: 2.5rem; display: grid; place-items: center;
  background: var(--seal); color: #fff; font: 700 1.05rem var(--serif); border-radius: 3px; box-shadow: 0 0 0 6px var(--ink);
}
.chain h3 { color: #fff; margin-bottom: .35rem; }
.chain p { color: #c3cad4; font-size: .98rem; margin: 0; }
@media (max-width: 760px) {
  .chain { grid-template-columns: 1fr; gap: 1.25rem; }
  .chain::before { left: 1.25rem; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .chain li { padding: 0 0 0 3.75rem; min-height: 2.5rem; }
}

/* ---------- generic blocks ---------- */
.block { padding: clamp(2.25rem, 5vw, 3.75rem) 1.25rem; }
.block + .block { padding-top: 0; }
.page-head { padding-top: clamp(1.5rem, 4vw, 2.75rem); padding-bottom: clamp(1.5rem, 3vw, 2rem); }
.page-head .btn { margin-top: .5rem; }
.page-head + .block { padding-top: clamp(1rem, 2.5vw, 1.75rem); }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.prose { max-width: 42em; }
.lang-zh .prose { max-width: 36em; }
.panel { background: var(--white); border: 1px solid var(--rule); border-top: 3px solid var(--seal); padding: 1.5rem; border-radius: 0 0 var(--radius) var(--radius); }
.panel h2 { font-size: 1.3rem; }
.panel h3 { margin-top: 1.5rem; }
@media (max-width: 860px) { .two-col, .hero-grid { grid-template-columns: 1fr; } .hero-art { max-width: 20rem; } }

/* index rows (services / languages) */
.index-rows { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); column-gap: clamp(1.5rem, 4vw, 3rem); }
.index-rows-3 { grid-template-columns: repeat(3, 1fr); }
.index-rows li { border-top: 1px solid var(--rule); }
.index-rows a { display: block; padding: 1.1rem 0 1.25rem; text-decoration: none; color: var(--ink); }
.row-title { display: block; font-family: var(--serif); font-weight: 700; font-size: 1.2rem; margin-bottom: .2rem; }
.row-desc { display: block; color: var(--ink-2); font-size: .98rem; }
.index-rows a:hover .row-title { color: var(--seal); }
.two-col .index-rows { grid-template-columns: 1fr; }
@media (max-width: 760px) { .index-rows, .index-rows-3 { grid-template-columns: 1fr; } }
@media (min-width: 761px) and (max-width: 1000px) { .index-rows-3 { grid-template-columns: repeat(2, 1fr); } }

/* regions */
.regions { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.5rem 2rem; margin-top: 1.5rem; }
.region h3 { font-size: 1rem; font-family: var(--sans); color: var(--ink-3); font-weight: 600; margin-bottom: .5rem; padding-bottom: .4rem; border-bottom: 1px solid var(--rule); }
.region ul { list-style: none; padding: 0; margin: 0; }
.region li a { display: block; padding: .25rem 0; color: var(--ink); text-decoration: none; }
.region li a:hover { color: var(--seal); text-decoration: underline; }

/* lists */
.ticks, .plain { padding: 0; margin: 0; list-style: none; }
.ticks li { position: relative; padding: .35rem 0 .35rem 1.6rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .85em; width: .7rem; height: .7rem; border: 2px solid var(--seal); border-radius: 2px; transform: rotate(45deg) scale(.8); }
.plain li { padding: .45rem 0; border-bottom: 1px solid var(--paper-2); }
.plain li:last-child { border-bottom: 0; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: .2rem 0 1rem 2.75rem; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: .1rem; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border: 1.5px solid var(--seal); color: var(--seal); font: 700 .95rem var(--serif); border-radius: 2px; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: .95rem; top: 2.2rem; bottom: .2rem; width: 1px; background: var(--rule); }
.steps p { margin: 0; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; }
.chips a { display: inline-block; padding: .45rem .85rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--white); color: var(--ink); text-decoration: none; font-size: .95rem; }
.chips a:hover { border-color: var(--seal); color: var(--seal); }
.chips-invert a { background: transparent; border-color: #4a5a72; color: #fff; }
.chips-invert a:hover { border-color: #fff; color: #fff; }

.lang-cloud { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }
.lang-cloud a { color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 1.1rem; }
.lang-cloud a:hover { color: var(--seal); }
.native { font-family: var(--sans); font-size: .85rem; color: var(--ink-3); }

/* facts */
.facts { margin: 0; }
.facts > div { padding: .6rem 0; border-bottom: 1px solid var(--paper-2); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-size: .85rem; color: var(--ink-3); font-weight: 600; }
.facts dd { margin: .1rem 0 0; }

/* faq */
.faq-list { border-top: 1px solid var(--rule); max-width: 50rem; }
.faq { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; padding: 1.1rem 2.5rem 1.1rem 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { margin: 0; font-size: 1.1rem; text-wrap: pretty; }
.faq summary::after { content: "+"; position: absolute; right: .25rem; top: .9rem; font: 400 1.6rem/1 var(--sans); color: var(--seal); }
.faq[open] summary::after { content: "−"; }
.faq-a { padding: 0 0 1.1rem; color: var(--ink-2); max-width: 42em; }

/* cta band */
.cta-band { background: var(--paper-2); border-top: 1px solid var(--rule); padding: clamp(2.25rem, 5vw, 3.5rem) 0; margin-top: clamp(1rem, 3vw, 2rem); }
.cta-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: center; }
.cta-inner p { color: var(--ink-2); max-width: 36em; margin: 0; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; }
.cta-direct { font-size: .95rem; line-height: 1.6; }
@media (max-width: 760px) { .cta-inner { grid-template-columns: 1fr; } }

/* ---------- contact form ---------- */
.contact-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.quote-form { display: grid; gap: 1rem; background: var(--white); border: 1px solid var(--rule); padding: clamp(1.25rem, 3vw, 2rem); border-radius: var(--radius); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: end; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.field { display: grid; gap: .35rem; }
.field > span { font-weight: 600; font-size: .95rem; }
.field small { color: var(--ink-3); font-size: .85rem; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper); border: 1px solid #c3c9c3; border-radius: var(--radius);
  padding: .7rem .8rem; width: 100%;
}
.field input[type="file"] { background: transparent; border-style: dashed; padding: .9rem .8rem; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--jade); outline-offset: 0; border-color: var(--jade); background: var(--white); }
.field.invalid input, .field.invalid select, .field.invalid textarea, .check.invalid { outline: 2px solid var(--seal); outline-offset: 0; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .95rem; color: var(--ink-2); border-radius: var(--radius); padding: .2rem; }
.check input { margin-top: .35rem; width: 1.1rem; height: 1.1rem; accent-color: var(--seal); flex: none; }
.quote-form .btn { justify-self: start; }
.form-status { margin: 0; font-weight: 600; min-height: 1.5em; }
.form-status.ok { color: var(--jade); }
.form-status.err { color: var(--seal); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-direct p { display: grid; gap: .1rem; }
.contact-direct .k { font-size: .85rem; color: var(--ink-3); font-weight: 600; }
.contact-direct a { font-size: 1.1rem; word-break: break-word; }

/* ---------- footer ---------- */
.site-footer { background: #15202f; color: #b9c1cc; padding: 3rem 0 1.5rem; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 2rem; }
.site-footer h2 { font-family: var(--sans); font-size: .95rem; color: #fff; margin-bottom: .75rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: .2rem 0; }
.site-footer a { color: #d7dce3; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.logo-invert, .logo-invert:hover { color: #fff; }
.logo-invert .logo-text small { color: #8d97a5; }
.footer-brand p { margin-top: 1rem; max-width: 26em; }
.footer-base { border-top: 1px solid #2a384b; margin-top: 2.5rem; padding-top: 1.25rem; font-size: .85rem; color: #8d97a5; }
.footer-base p { margin: 0; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

@media print {
  .site-header, .site-footer, .cta-band, .hero-art { display: none; }
  body { background: #fff; }
}
