@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700&family=Noto+Sans:wght@300;400;500;700&display=swap');

:root {
  --mint: #5cc6b0;
  --sand: #d4c4a8;
  --ink: #172623;
  --clay: #c67b5c;
  --olive: #6b7b3c;
  --bg: #f4ece0;
  --bg-2: #efe5d6;
  --card: #fbf6ee;
  --line: #e0d2bd;
  --muted: #5d6d64;
  --r: 18px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding-bottom: 96px;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 520px at 88% -8%, #f9f2e5 0%, rgba(249, 242, 229, 0) 62%),
    radial-gradient(760px 460px at 4% 22%, #eef3ea 0%, rgba(238, 243, 234, 0) 60%),
    var(--bg);
  color: var(--ink);
  font-family: 'Figtree', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .30;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
}

h1, h2, h3, h4 {
  font-family: 'Figtree', 'Noto Sans', system-ui, sans-serif;
  color: var(--ink);
}

a { color: #2a6b5c; }

img { max-width: 100%; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(26px, 6vw, 78px);
  padding-bottom: clamp(120px, 16vh, 168px);
  overflow: hidden;
  background: linear-gradient(155deg, #33473d 0%, #1d2f29 55%, #172623 100%);
  scroll-margin-top: 0;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img,
.hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to left, rgba(23, 38, 35, .93) 0%, rgba(23, 38, 35, .62) 46%, rgba(23, 38, 35, .18) 100%),
    linear-gradient(to top, rgba(23, 38, 35, .8) 0%, rgba(23, 38, 35, 0) 52%);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .45;
  background-image: radial-gradient(circle, rgba(212, 196, 168, .55) 1px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to left, #000 0%, rgba(0, 0, 0, .1) 78%);
  mask-image: linear-gradient(to left, #000 0%, rgba(0, 0, 0, .1) 78%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 660px;
  text-align: right;
  color: #f8f2e6;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 5.6vw, 56px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.012em;
  color: #fbf6ea;
  text-shadow: 0 2px 22px rgba(10, 20, 17, .45);
}

.hero-desc {
  margin: 0;
  font-size: clamp(16px, 1.9vw, 19px);
  font-weight: 300;
  line-height: 1.65;
  color: #dde6dd;
}

/* ---------- layout ---------- */
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(20px, 3vw, 38px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 66px) clamp(16px, 4vw, 40px) clamp(20px, 4vw, 40px);
  position: relative;
  z-index: 3;
}

article { min-width: 0; }

article > section {
  background: var(--card);
  border-radius: var(--r);
  padding: clamp(20px, 3.4vw, 40px);
  margin-bottom: clamp(16px, 2.4vw, 26px);
  box-shadow: 0 16px 34px -30px rgba(23, 38, 35, .8);
  scroll-margin-top: 26px;
  scroll-margin-bottom: 104px;
}

article > section:nth-child(even) {
  background: #f7f0e3;
  border-radius: 26px 18px 26px 18px;
}

article > section:last-child { margin-bottom: 0; }

article p { margin: 0 0 1em; }
article p:last-child { margin-bottom: 0; }

article h2 {
  margin: 0 0 4px;
  font-size: clamp(21px, 2.5vw, 29px);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -.008em;
}

article h3 {
  margin: 1.4em 0 .4em;
  font-size: clamp(17px, 1.8vw, 20px);
  font-weight: 600;
  line-height: 1.45;
}

article ul,
article ol {
  margin: 0 0 1em;
  padding-left: 1.35em;
}

article li { margin: .35em 0; }

article strong { font-weight: 600; }

article blockquote {
  margin: 1.2em 0;
  padding: .7em 1.1em;
  border-left: 3px solid var(--mint);
  border-radius: 0 14px 14px 0;
  background: #edf6f2;
  color: #26403a;
}

article a {
  color: #276b5b;
  text-decoration: underline;
  text-decoration-color: var(--mint);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

article a:hover { color: var(--clay); }

article img {
  height: auto;
  border-radius: 14px;
}

article code {
  padding: .12em .38em;
  border-radius: 6px;
  background: #ece2d1;
  font-size: .92em;
}

article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

article th,
article td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

hr {
  height: 1px;
  margin: 0 0 20px;
  border: 0;
  background: linear-gradient(90deg, var(--sand) 0%, rgba(212, 196, 168, .1) 78%, transparent 100%);
}

/* ---------- rail ---------- */
.rail {
  align-self: start;
  padding: 20px;
  border-radius: var(--r);
  background: #eae2d4;
  font-size: 15px;
}

.rail-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
}

.rail hr { margin-bottom: 12px; }

.rail menu,
.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-list li + li { border-top: 1px dashed #d6c8b2; }

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 2px;
  color: #2f443b;
  text-decoration: none;
  line-height: 1.4;
}

.rail-list a::before {
  content: '';
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-right: 9px;
  border-radius: 50% 50% 5px 50%;
  background: var(--olive);
  opacity: .8;
}

.rail-list a:hover { color: #172623; }

.rail-top {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid #d9cbb6;
}

.rail-top a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #46604f;
  text-decoration: none;
  font-size: 14px;
}

/* ---------- footer ---------- */
.foot {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: clamp(28px, 5vw, 56px);
  padding: clamp(30px, 5vw, 58px) clamp(16px, 4vw, 40px) 26px;
  background: #172623;
  color: #e6e0d2;
  position: relative;
  z-index: 3;
}

.foot section { min-width: 0; }

.foot-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: #f4eee1;
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
}

.foot-desc {
  margin: 10px 0 0;
  max-width: 42ch;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  color: #a9bcb1;
}

.foot-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-list a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 4px 0;
  color: #cfe0d8;
  font-size: 15px;
  text-decoration: none;
}

.foot-list a::before {
  content: '';
  width: 6px;
  height: 6px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--mint);
  opacity: .7;
}

.foot-list a:hover { color: #fff; }

.foot-copy {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid #2b4038;
  font-size: 14px;
  color: #93a79c;
}

/* ---------- bottom bar ---------- */
.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px clamp(12px, 4vw, 26px);
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(246, 239, 228, .95);
  border-top: 1px solid var(--line);
  box-shadow: 0 -14px 34px -26px rgba(23, 38, 35, .9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.mark {
  display: block;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 6px;
  object-fit: cover;
  background: linear-gradient(140deg, var(--mint), var(--sand));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 4px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -.005em;
}

.brand span:last-child { white-space: nowrap; }

.menu { position: relative; }

.menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #f2ebe0;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
}

.menu summary::-webkit-details-marker { display: none; }

.menu summary::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .25s var(--ease);
}

.menu[open] summary::after {
  transform: rotate(-135deg) translateY(-2px);
}

.menu > menu {
  position: fixed;
  right: 8px;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  left: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 62vh;
  margin: 0;
  padding: 10px;
  overflow: auto;
  list-style: none;
  border-radius: 22px;
  background: #172623;
  box-shadow: 0 -22px 54px -26px rgba(23, 38, 35, .9);
}

.menu > menu a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 14px;
  color: #ece4d5;
  font-size: 15px;
  text-decoration: none;
  line-height: 1.35;
}

.menu > menu a::before {
  content: '';
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50% 50% 6px 50%;
  background: var(--mint);
  opacity: .9;
}

.menu > menu li:nth-child(2n) a::before { background: var(--sand); }
.menu > menu li:nth-child(3n) a::before { background: var(--clay); }

.menu > menu a:hover { background: #23372f; }

/* ---------- reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity .62s var(--ease) calc(var(--i, 0) * 55ms),
    transform .62s var(--ease) calc(var(--i, 0) * 55ms);
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- breakpoints ---------- */
@media (min-width: 720px) {
  .foot { grid-template-columns: 1.5fr 1fr; }
}

@media (min-width: 860px) {
  .brand { font-size: 16px; }

  .menu {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .menu > menu {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    max-height: none;
    padding: 0;
    overflow: visible;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .menu > menu a {
    padding: 8px 10px;
    border-radius: 12px;
    color: var(--ink);
    font-size: 15px;
  }

  .menu > menu a::before {
    width: 6px;
    height: 6px;
    opacity: .85;
  }

  .menu > menu a:hover { background: #e8dfce; }
}

@media (min-width: 960px) {
  main {
    grid-template-columns: minmax(0, 1fr) 268px;
    align-items: start;
  }

  .rail {
    position: sticky;
    top: 26px;
  }

  div > article { scroll-margin-top: 30px; }
}

@media (max-width: 420px) {
  .hero {
    padding: 22px 20px 132px;
    align-items: flex-end;
    justify-content: flex-end;
  }

  .hero-inner { max-width: 100%; }

  div > article { border-radius: 14px; }

  .menu > menu { grid-template-columns: 1fr; }
}

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

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .menu summary::after { transition: none; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
