/* 邁林國際 — black / white / red. System CJK fonts only. */

:root {
  --bg: #ffffff;
  --ink: #141414;
  --muted: #3a3a3a;
  --line: #e6e6e6;
  --red: #c4162a;
  --red-on-dark: #ff4d5a;
  --header: #111111;
  --band: #111111;
  --soft: #f7f7f7;
  --header-offset: 7.25rem;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-offset);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang TC", "Hiragino Sans CNS", "Hiragino Sans", "Noto Sans CJK TC", "Noto Sans CJK JP",
    "Source Han Sans TC", "Source Han Sans", "Microsoft JhengHei", "Microsoft JhengHei UI", "Heiti TC",
    "Yu Gothic UI", "Yu Gothic", "Meiryo", "WenQuanYi Micro Hei", "Droid Sans Fallback", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.3;
  font-weight: 700;
}

h1 {
  font-size: clamp(1.7rem, 2.2vw + 1.15rem, 3.35rem);
  letter-spacing: 0;
  text-wrap: pretty;
}

h2 {
  font-size: clamp(1.45rem, 1.2vw + 1.1rem, 2.15rem);
}

h3 {
  font-size: 1.2rem;
}

a {
  color: inherit;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.site-header :focus-visible,
.band :focus-visible,
.site-footer :focus-visible {
  outline-color: #ffffff;
}

::selection {
  background: #111111;
  color: #ffffff;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-140%);
  background: #ffffff;
  color: #111111;
  padding: 0.65rem 1rem;
  z-index: 80;
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  transform: none;
}

.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;
}

.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.wrap {
  width: min(1120px, 100%);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
}

.section {
  padding-block: clamp(3.5rem, 7vw, 6rem);
}

section[id] {
  scroll-margin-top: var(--header-offset);
}

.idx {
  margin: 0 0 0.45rem;
  color: var(--red);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.section-label {
  margin: 0 0 0.85rem;
  color: var(--red);
  font-size: 0.9375rem;
  font-weight: 700;
}

.lede {
  max-width: 42rem;
  margin-top: 1.25rem;
  color: var(--ink);
}

.lede,
.bio-prose,
.facts dd,
.card p {
  text-wrap: pretty;
  overflow-wrap: break-word;
}

html[lang="zh-Hant"] .lede,
html[lang="zh-Hant"] .bio-prose,
html[lang="zh-Hant"] .facts dd,
html[lang="ja"] .lede,
html[lang="ja"] .bio-prose,
html[lang="ja"] .facts dd,
html[lang="ja"] .card p {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.h1-sub {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.48em;
  font-weight: 650;
  letter-spacing: 0;
}

.en-name {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 1.05rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header);
  color: #ffffff;
  border-top: 3px solid var(--red);
}

.header-inner {
  width: min(1120px, 100%);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2rem);
  min-height: 4.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  position: static;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-right: auto;
}

.logo-mark {
  width: 32px;
  height: 32px;
  flex: none;
  display: block;
}

.logo-text {
  font-size: 1rem;
  letter-spacing: 0.14em;
}

html[lang="en"] .logo-text {
  letter-spacing: 0.18em;
  font-size: 0.95rem;
}

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

.nav-toggle:focus {
  outline: none;
}

.nav-toggle:focus-visible + .menu-button {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}

.menu-button {
  display: none;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  min-width: 44px;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.bars,
.bars::before,
.bars::after {
  display: block;
  width: 1.15rem;
  height: 2px;
  background: var(--red-on-dark);
  position: relative;
}

.bars::before,
.bars::after {
  content: "";
  position: absolute;
  left: 0;
  background: #ffffff;
}

.bars::before {
  top: -6px;
}

.bars::after {
  top: 6px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.site-nav a {
  color: #ffffff;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  padding-top: 2px;
}

.site-nav a:hover,
.site-nav a[aria-current="true"] {
  border-bottom-color: var(--red-on-dark);
}

.langs {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.langs a {
  color: #ffffff;
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.55rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.langs a[aria-current="page"] {
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--red-on-dark);
}

.lang-sep {
  color: #ffffff;
  opacity: 1;
  user-select: none;
}

@media (min-width: 1200px) {
  .menu-button,
  .nav-toggle {
    display: none;
  }
}

@media (max-width: 1199px) {
  :root {
    --header-offset: 8.5rem;
  }

  .header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0;
    padding-block: 0.15rem 0.25rem;
  }

  .logo {
    order: 1;
    flex: 1 1 auto;
    margin-right: 0;
    min-width: 0;
  }

  .menu-button {
    display: inline-flex;
    order: 2;
    margin-left: auto;
  }

  .langs {
    order: 3;
    flex: 1 0 100%;
  }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 50;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #111111;
    padding: 0.15rem clamp(1.1rem, 4vw, 2rem) 0.75rem;
    border-top: 1px solid #2a2a2a;
    border-bottom: 2px solid var(--red);
  }

  .nav-toggle:checked ~ .site-nav {
    display: flex;
  }

  .site-nav a {
    border-bottom: 1px solid #2a2a2a;
    min-height: 48px;
  }
}

/* About */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(16rem, 0.8fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  margin-top: 0.5rem;
}

.reserve {
  margin-top: 1.75rem;
  padding: 0.9rem 1rem 1rem;
  border-left: 3px solid var(--red);
  box-shadow: inset 0 0 0 1px var(--line);
  max-width: 40rem;
}

.reserve strong {
  color: var(--red);
  font-weight: 700;
}

.reserve p {
  margin-top: 0.35rem;
  color: var(--muted);
}

.facts {
  display: grid;
  gap: 0;
}

.facts div {
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
}

.facts div:last-child {
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--red);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.facts dd {
  margin: 0.3rem 0 0;
}

/* Founder */

.band {
  background: var(--band);
  color: #ffffff;
  scroll-margin-top: var(--header-offset);
}

.band .idx {
  color: var(--red-on-dark);
}

.founder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding-block: clamp(3.25rem, 6vw, 5rem);
}

.founder-copy h2 {
  max-width: 20em;
}

.founder-link {
  margin-top: 1.5rem;
}

.portrait {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 4 / 5;
  justify-self: end;
  background: #1c1c1c;
  border: 1px solid #3a3a3a;
  box-shadow: inset 4px 4px 0 var(--red);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: #ffffff;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
}

.bio {
  padding-block: clamp(2.75rem, 5vw, 4.25rem) clamp(3.5rem, 7vw, 5.5rem);
}

.bio-prose {
  max-width: 42rem;
  display: grid;
  gap: 1.15rem;
}

.bio-prose p {
  margin: 0;
}

/* Services */

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.75rem;
}

.card {
  background: #ffffff;
  padding: 1.4rem 1.3rem 1.5rem;
  border-top: 2px solid var(--red);
  box-shadow: inset 0 0 0 1px #ececec;
  display: grid;
  align-content: start;
  gap: 0.7rem;
}

.card p {
  color: var(--ink);
}

.tag {
  color: var(--red);
  font-size: 0.875rem;
  font-weight: 700;
  margin-top: 0.35rem;
}

/* Cases */

.cases {
  list-style: none;
  padding: 0;
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.cases li {
  min-height: 9.5rem;
  border: 1px dashed #c8c8c8;
  background: #ffffff;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 0.55rem;
  padding: 1.1rem 1rem 1.2rem;
  position: relative;
}

.cases li::before {
  content: "";
  width: 1.4rem;
  height: 2px;
  background: var(--red);
}

.case-no {
  color: var(--red);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.case-label {
  color: var(--muted);
}

/* Contact */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
  margin-top: 0.5rem;
}

.contact-intro {
  margin-top: 1rem;
  max-width: 36rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 0.6rem;
  color: var(--red);
  font-weight: 700;
  text-underline-offset: 0.18em;
}

.phone-link {
  color: var(--ink);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 1rem;
}

.field-span,
.form-actions,
.form-status {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.req {
  color: var(--red);
  margin-left: 0.15rem;
}

.hint {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

input,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #c4c4c4;
  border-radius: 0;
  padding: 0.7rem 0.75rem;
  min-height: 48px;
}

textarea {
  min-height: 9.5rem;
  resize: vertical;
  line-height: 1.6;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--red);
}

.field-error {
  min-height: 0;
  margin: 0.3rem 0 0.45rem;
  color: var(--red);
  font-size: 0.875rem;
  font-weight: 700;
}

.field-error:empty {
  display: none;
}

.form-status {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--red);
  box-shadow: inset 0 0 0 1px #ececec;
}

.form-status:empty {
  display: none;
}

.button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 48px;
  padding: 0.75rem 1.3rem;
  background: var(--red);
  color: #ffffff;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}

.button:hover {
  background: #a51224;
}

.button:disabled {
  cursor: progress;
}

.form-actions {
  margin-top: 0.4rem;
}

/* Footer */

.site-footer {
  background: #111111;
  color: #ffffff;
  border-top: 3px solid var(--red);
  padding-block: 2.5rem 2.75rem;
}

.footer-grid {
  display: grid;
  gap: 0.7rem;
}

.site-footer a {
  color: #ffffff;
  text-underline-offset: 0.18em;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin-top: 0.6rem;
}

.site-footer nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-footer nav a:hover {
  border-bottom-color: var(--red-on-dark);
}

.footer-copy {
  font-weight: 700;
}

address {
  font-style: normal;
}

.footer-name {
  color: #ffffff;
}

/* Result page (no-JS form response) */

.result {
  padding-block: 4rem 5rem;
  max-width: 40rem;
}

.result h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.result ul {
  margin-top: 1rem;
  padding-left: 1.2rem;
}

.result .button {
  margin-top: 1.5rem;
}

/* Narrow phones and fold covers */

@media (max-width: 800px) {
  .about-grid,
  .contact-grid,
  .founder-grid,
  .cards {
    grid-template-columns: 1fr;
  }

  .portrait {
    justify-self: start;
    max-width: 180px;
  }

  .founder-grid {
    padding-block: 2.75rem;
  }
}

@media (max-width: 640px) {
  .form-grid,
  .cases {
    grid-template-columns: 1fr;
  }

  .form-actions .button,
  .founder-link .button {
    width: 100%;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .cases {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .site-header,
  .menu-button,
  .langs,
  .site-footer nav {
    display: none;
  }

  .band,
  .site-footer {
    background: #ffffff;
    color: #000000;
  }

  body {
    font-size: 12pt;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}

/* Official logo: white header so the black wordmark stays visible. */
.site-header { background: #ffffff; color: var(--ink); border-top: 0; border-bottom: 2px solid var(--red); }
.site-header :focus-visible { outline-color: var(--ink); }
.logo { color: var(--ink); min-width: 0; }
.logo picture { display: block; line-height: 0; }
.logo-img { display: block; height: 40px; width: auto; max-width: 100%; }
.menu-button, .site-nav a, .langs a, .lang-sep { color: var(--ink); }
.bars { background: var(--red); }
.bars::before, .bars::after { background: var(--ink); }
.nav-toggle:focus-visible + .menu-button { outline-color: var(--ink); }
.site-nav a:hover, .site-nav a[aria-current="true"] { border-bottom-color: var(--red); }
.langs a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--red); }
@media (max-width: 1199px) {
  .logo-img { height: 28px; }
  .site-nav { background: #ffffff; border-top: 1px solid var(--line); }
  .site-nav a { border-bottom-color: var(--line); }
}

/* Past clients page */
.cases-more { margin-top: 1.5rem; }
.clients-page h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.client-group { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 0 1.5rem; border-top: 1px solid var(--line); }
.client-group li { border-bottom: 1px solid var(--line); }
.client-group a { display: flex; align-items: center; min-height: 48px; padding: 0.4rem 0; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.client-group a:hover { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.clients-page .back { margin-top: 2.5rem; }

/* News */
.news-list { list-style: none; margin: 1.25rem 0 0; padding: 0; border-top: 1px solid var(--line); max-width: 44rem; }
.news-list li { border-bottom: 1px solid var(--line); }
.news-list a, .news-list span { display: flex; align-items: center; min-height: 48px; padding: 0.5rem 0 0.5rem 1rem; border-left: 3px solid var(--red); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.news-list a:hover { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }

/* Home hero: carousel + news */
.hero { padding-top: clamp(1.5rem, 4vw, 3rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.carousel { position: relative; overflow: hidden; border: 1px solid var(--line); background: #ffffff; min-width: 0; }
.carousel-track { list-style: none; margin: 0; padding: 0; display: flex; transition: transform 0.45s ease; }
.carousel-slide { flex: 0 0 100%; min-width: 0; }
.carousel-slide a { display: block; }
.carousel-slide img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.carousel-btn { position: absolute; top: calc(50% - 22px); width: 44px; height: 44px; border: 1px solid var(--ink); background: rgba(255,255,255,0.92); color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.carousel-btn.prev { left: 0.5rem; }
.carousel-btn.next { right: 0.5rem; }
.carousel-btn:hover { color: var(--red); border-color: var(--red); }
.carousel-dots { display: flex; justify-content: center; gap: 0.25rem; padding: 0.35rem 0; }
.carousel-dot { width: 28px; height: 28px; border: 0; background: transparent; cursor: pointer; position: relative; }
.carousel-dot::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: #c8c8c8; }
.carousel-dot[aria-current="true"]::after { background: var(--red); }
.carousel :focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.hero-news h2 { margin-top: 0; }
.hero-news .news-list { margin-top: 0.75rem; }
@media (max-width: 1199px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .carousel-track { transition: none; } }

/* Header company name */
.logo { gap: 0.75rem; }
.logo-name { display: flex; flex-direction: column; justify-content: center; min-width: 0; line-height: 1.15; }
.logo-name-main { font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", sans-serif; font-weight: 700; color: #111111; font-size: 1.05rem; letter-spacing: 0.04em; white-space: nowrap; }
.logo-since { font-size: 0.72rem; font-weight: 500; color: #6b6b6b; letter-spacing: 0.08em; margin-top: 0.15rem; }
.logo-since::before { content: ""; display: inline-block; width: 0.9em; height: 2px; background: var(--red); vertical-align: middle; margin-right: 0.35em; }
@media (max-width: 1199px) { .logo { gap: 0.5rem; } .logo-name-main { font-size: 0.92rem; letter-spacing: 0.02em; } .logo-since { font-size: 0.66rem; } }
@media (max-width: 400px) { .logo-img { height: 24px; } .logo-name-main { font-size: 0.8rem; letter-spacing: 0; } }
@media (max-width: 360px) { .logo-since { display: none; } .logo-name-main { font-size: 0.76rem; } .logo { gap: 0.4rem; } }

/* Industry trends */
.hero-side { display: grid; gap: 2rem; min-width: 0; }
.trends h2 { margin-top: 0; }
.trend-byline { margin-top: 0.25rem; font-size: 0.8rem; color: #6b6b6b; }
.trend-list { list-style: none; margin: 0.75rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.trend-item { padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.trend-title { font-size: 1rem; margin: 0; line-height: 1.45; }
.trend-summary { margin-top: 0.35rem; font-size: 0.9rem; color: var(--muted); line-height: 1.7; overflow-wrap: anywhere; }
.trend-meta { margin-top: 0.35rem; font-size: 0.78rem; color: #6b6b6b; }
.trend-meta a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; }
/* Narrow header: icon-only menu button so the company name fits */
@media (max-width: 400px) { .menu-button { font-size: 0; gap: 0; } }

/* Trend pages */
.trend-title a { color: var(--ink); text-decoration: none; }
.trend-title a:hover { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.trend-more { margin-top: 0.75rem; }
.trends-page h1, .trend-article h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.35; }
.trends-page .trend-list { max-width: 48rem; }
.trends-page h2.trend-title { font-size: 1.1rem; margin: 0; }
.trend-article .wrap { max-width: 48rem; }
.trend-body { margin-top: 1.25rem; font-size: 1.05rem; line-height: 1.9; overflow-wrap: anywhere; }
.crumbs { font-size: 0.82rem; color: #6b6b6b; margin-bottom: 1rem; }
.crumbs a { color: var(--ink); }
@media (min-width: 1200px) { .site-nav { gap: 1rem; } .site-nav a, .langs a { white-space: nowrap; font-size: 0.92rem; } .langs a { padding: 0 0.4rem; } .header-inner { gap: 0.75rem 1.25rem; } }
