/* 版面概念：氣勢來自留白與水平線，不靠放大。
   首屏只有家紋與四個字，海平線橫過畫面下緣；往下每段同一套左標題、右內容的格線。 */
:root {
  --paper: #e4e8e3;      /* 月白紙，刻意偏青，避開米黃 */
  --ink: #17211f;        /* 松煙墨 */
  --ink-soft: #4d5b56;
  --rule: #b3c0ba;
  --azurite: #17656f;    /* 石青 */
  --wash-1: #d6ddd8;
  --wash-2: #bccac5;
  --wash-3: #9db1ab;
  --sea-1: #123231;
  --sea-2: #1a4745;
  --sea-3: #29625f;
  --sea-fg: #e9ede7;
  --sea-soft: #a9c4bd;
  --sea-rule: #3b6663;

  --font-text: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --gutter: clamp(20px, 6vw, 96px);
}

:root[data-theme="ink"] {
  --paper: #101716;
  --ink: #e3e8e1;
  --ink-soft: #a5b5ae;
  --rule: #33453f;
  --azurite: #63c8c8;
  --wash-1: #17231f;
  --wash-2: #1f322e;
  --wash-3: #2c4843;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 40px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  font-weight: 400;
  line-height: 2;
  letter-spacing: .04em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, dl, dd, address { margin: 0; font-style: normal; font-weight: inherit; }

/* 中文只在標點處斷行，避免單字掉到下一行；太窄放不下時才退回逐字斷 */
h2, h3, p, dd, address {
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

a { color: inherit; }

:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.mon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.mon { display: block; width: 32px; height: 32px; flex: none; }

#water {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  image-rendering: pixelated;
  pointer-events: none;
}

main { position: relative; z-index: 1; }

/* 頁首：必須高於 main，否則首屏區塊會蓋住導覽連結 */
.site-header {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px max(var(--gutter), env(safe-area-inset-right, 0px)) 0 max(var(--gutter), env(safe-area-inset-left, 0px));
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-name { font-size: 15px; font-weight: 500; letter-spacing: .24em; }

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  font-size: 14px;
  letter-spacing: .14em;
}

.site-header nav a {
  text-decoration: none;
  padding-block: 4px;
  background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
  transition: background-size .3s ease;
}

.site-header nav a:hover { background-size: 100% 1px; }

#theme-toggle {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

#theme-toggle:hover { color: var(--ink); }

#theme-toggle .icon-sun { display: none; }

.is-ink #theme-toggle .icon-sun { display: block; }

.is-ink #theme-toggle .icon-moon { display: none; }

/* 首屏：高度留給海平線，第一眼就看得到水面 */
.hero {
  min-height: 80vh;
  min-height: 80svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 96px max(var(--gutter), env(safe-area-inset-right, 0px)) 72px max(var(--gutter), env(safe-area-inset-left, 0px));
  text-align: center;
}

.mon-hero { width: clamp(72px, 7vw, 96px); height: clamp(72px, 7vw, 96px); margin-bottom: 12px; }

.hero h1 {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .36em;
  margin-right: -.36em;
}

.hero-tag {
  font-size: clamp(14px, 1.2vw, 17px);
  letter-spacing: .32em;
  margin-right: -.32em;
}

/* 內容段落：同一套格線 */
.about, .services, .contact {
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 40px clamp(32px, 6vw, 96px);
  max-width: 1120px;
  margin-inline: auto;
}

.inner h2 {
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: .16em;
}

/* 關於：一整段都在水裡，水面由 canvas 畫 */
.about {
  color: var(--sea-fg);
  padding-block: clamp(120px, 20vh, 190px);
}

html:not(.js) .about, html:not(.js) .contact { background: var(--sea-1); }

.about-body { display: grid; gap: 16px; color: var(--sea-soft); }

.lede { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.9; color: var(--sea-fg); }

.tenets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px clamp(24px, 4vw, 56px);
  margin-top: 40px;
}

.tenets article { border-top: 1px solid var(--sea-rule); padding-top: 18px; }

.tenets h3 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .2em;
  margin-bottom: 8px;
  color: var(--sea-fg);
}

.tenets p { font-size: 15px; }

/* 產品服務：以文字和留白延續全站格線 */
.services {
  padding-block: clamp(140px, 20vh, 200px);
}

.services-body { display: grid; gap: 28px; max-width: 42em; line-height: 2.15; }

/* 海：底色由 canvas 畫出，海平面跟著本段頂端走 */
.contact {
  color: var(--sea-fg);
  padding-top: clamp(120px, 18vh, 170px);
}

.contact-email { font-size: clamp(16px, 1.5vw, 19px); overflow-wrap: anywhere; text-underline-offset: 5px; }

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: clamp(96px, 16vh, 150px);
  padding-block: 0 36px;
  color: var(--sea-soft);
  font-size: 12px;
  letter-spacing: .08em;
  text-align: center;
  padding-inline: var(--gutter);
}

@media (max-width: 760px) {
  .inner, .tenets { grid-template-columns: minmax(0, 1fr); }

  .tenets { margin-top: 24px; }
}

@media (max-width: 640px) {
  .brand-name { display: none; }

  .site-header nav { font-size: 13px; letter-spacing: .08em; gap: 14px; }

  .hero h1 { letter-spacing: .28em; margin-right: -.28em; }

  .hero-tag { letter-spacing: .24em; margin-right: -.24em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-header nav a { transition: none; }
}
