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

:root {
  --cream: #f5f0e8;
  --sand: #e8e0d5;
  --ink: #2b2b2b;
  --cinnabar: #c84b31;
  --gold: #c9a24b;
  --vermilion: #b3273a;
  --deepblue: #1f3a5f;
  --mist: #a8c4d6;
  --font-serif: "Source Han Serif", "Noto Serif CJK SC", "Songti SC", "STSong", serif;
  --font-sans: "Source Han Sans", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Cascadia Code", Consolas, monospace;
  --header-radius: 999px;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

ul,
ol {
  list-style: none;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--cinnabar);
  outline-offset: 2px;
}

.container {
  width: min(100% - 3rem, 1280px);
  margin-inline: auto;
}

.section {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

.col-main,
.col-side {
  min-width: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: var(--gold);
}

.breadcrumb a:hover {
  color: var(--cinnabar);
}

.breadcrumb [aria-current="page"] {
  color: var(--cinnabar);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 500;
  text-align: center;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  background-color: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.btn-primary {
  background-color: var(--cinnabar);
  border-color: var(--cinnabar);
  color: var(--cream);
}

.btn-primary:hover {
  background-color: var(--vermilion);
  border-color: var(--vermilion);
  color: var(--cream);
}

.btn-ghost {
  border-color: var(--cream);
  color: var(--cream);
}

.btn-ghost:hover {
  background-color: var(--cream);
  color: var(--ink);
  border-color: var(--cream);
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--ink);
  background: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.tag--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.tag--blue {
  background: var(--deepblue);
  border-color: var(--deepblue);
  color: var(--cream);
}

.index-mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--deepblue);
}

.image-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--ink);
  background: var(--sand);
  overflow: hidden;
}

.image-frame::after {
  content: "IMG";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--deepblue);
}

.image-frame--wide {
  aspect-ratio: 16 / 9;
}

.image-frame--portrait {
  aspect-ratio: 3 / 4;
}

/* ===== Header ===== */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2000;
  padding: 0.75rem 1.25rem;
  background: var(--cinnabar);
  color: var(--cream);
  font-weight: 500;
  transform: translateY(-150%);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 1rem;
  z-index: 1000;
  width: 100%;
  padding: 0 1.25rem;
  margin-top: 1rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  background: rgba(245, 240, 232, 0.94);
  border: 1px solid var(--ink);
  border-radius: var(--header-radius);
  box-shadow: 4px 4px 0 rgba(43, 43, 43, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-seal {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--cinnabar);
  color: var(--cream);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.brand-index {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  color: var(--deepblue);
}

.site-nav {
  min-width: 0;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  color: var(--ink);
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--sand);
  color: var(--ink);
}

.nav-link[aria-current="page"] {
  background: var(--deepblue);
  color: var(--cream);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.nav-toggle:hover {
  border-color: var(--deepblue);
}

.nav-toggle-bars {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: currentColor;
  position: relative;
  transition: background-color 0.2s ease;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s ease, top 0.2s ease;
}

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

.nav-toggle-bars::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav-toggle-text {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
}

/* ===== Footer ===== */
.site-footer {
  margin-top: auto;
  background: var(--ink);
  color: var(--cream);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.brand-seal--footer {
  background: var(--gold);
  color: var(--ink);
}

.brand-name--footer {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--cream);
}

.footer-tagline {
  max-width: 28rem;
  color: var(--sand);
  font-size: 0.9375rem;
}

.footer-nav {
  min-width: 0;
}

.footer-contact-label {
  display: block;
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.footer-list {
  display: grid;
  gap: 0.75rem;
}

.footer-link {
  color: var(--sand);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-link:hover {
  color: var(--cream);
  border-bottom-color: var(--gold);
}

.footer-contact {
  min-width: 0;
}

.footer-contact-line {
  display: block;
  color: var(--sand);
  font-size: 0.875rem;
  line-height: 1.8;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(245, 240, 232, 0.2);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--sand);
}

.footer-icp {
  color: var(--sand);
}

.footer-bottom-note {
  color: var(--cream);
}

/* ===== Back to top ===== */
.to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 900;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--cream);
  background: var(--deepblue);
  color: var(--cream);
  font-size: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--cinnabar);
  border-color: var(--cinnabar);
}

/* ===== Responsive ===== */
@media (min-width: 768px) {
  .content-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 2.5rem;
  }

  .col-main {
    grid-column: span 8;
  }

  .col-side {
    grid-column: 4;
  }

  .footer-inner {
    grid-template-columns: 2fr 1fr 2fr;
    gap: 3rem;
  }
}

@media (max-width: 767px) {
  .header-inner {
    flex-wrap: wrap;
    border-radius: 24px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    flex: 1 0 100%;
  }

  .site-nav[data-open] {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    width: 100%;
  }

  .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 8px;
  }

  .brand-index {
    display: none;
  }
}

@media (max-width: 480px) {
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
