/* ===== U米 Site Kit — /assets/site.css ===== */

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

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul[class],
ol[class] {
  padding: 0;
  list-style: none;
}

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

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

button {
  cursor: pointer;
  background: none;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ----- tokens ----- */
:root {
  --deep-1: #0B2239;
  --deep-2: #14304C;
  --deep-3: #1E4A72;
  --mist: #F4F7F9;
  --card: #E6ECF1;
  --cyan: #00E5D0;
  --orange: #FF7A3D;
  --steel: #9FB3C8;
  --ink: #0F1A24;

  --tag-phone: #A3B1A0;
  --tag-tablet: #C4A79B;
  --tag-desktop: #9FA8C4;
  --tag-accessory: #C9C0A8;

  --rail-w: 240px;
  --gap: 8px;
  --pad-x: 24px;
  --section-space: 96px;

  --font-display: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Menlo", "Consolas", monospace;

  --line: rgba(159, 179, 200, 0.28);
  --line-soft: rgba(159, 179, 200, 0.14);
  --focus: #00E5D0;
  --shadow-1: 0 1px 0 rgba(11, 34, 57, 0.06), 0 8px 24px rgba(11, 34, 57, 0.06);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ----- base ----- */
html, body { min-height: 100%; }

body {
  background: var(--deep-1);
  color: var(--mist);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(159, 179, 200, 0.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(159, 179, 200, 0.09) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.55;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}

h1 { font-size: 44px; }
h2 { font-size: 36px; }
h3 { font-size: 26px; }
h4 { font-size: 18px; line-height: 1.4; }

p { max-width: 68ch; }

::selection {
  background: var(--cyan);
  color: var(--deep-1);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ----- skip link ----- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--cyan);
  color: var(--deep-1);
  font-weight: 700;
  border-radius: 2px;
  transition: top 160ms var(--ease);
}

.skip-link:focus {
  top: 12px;
}

/* ----- shell ----- */
.site-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

.content {
  min-width: 0;
  background: var(--deep-1);
}

.content__inner {
  max-width: 1120px;
  padding: var(--section-space) var(--pad-x);
}

/* ----- mobile topbar ----- */
.site-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 60;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(11, 34, 57, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.site-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.site-topbar__mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.03em;
  color: var(--mist);
}

.site-topbar__badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--cyan);
  border: 1px solid rgba(0, 229, 208, 0.45);
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.04em;
}

/* ----- rail / sidebar ----- */
.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 20px 20px;
  background: var(--deep-2);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  z-index: 70;
}

.rail__brand {
  display: grid;
  gap: 6px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.rail__mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.04em;
  color: var(--mist);
  line-height: 1;
}

.rail__mark:hover { color: var(--cyan); }

.rail__badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--cyan);
  border-left: 2px solid var(--cyan);
  padding-left: 8px;
}

.rail__tagline {
  font-size: 12px;
  color: var(--steel);
  letter-spacing: 0.08em;
}

.rail__search {
  display: grid;
  gap: 6px;
}

.search-field__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--steel);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  background: var(--deep-1);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.search-field:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(0, 229, 208, 0.18);
}

.search-field__input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 9px 0;
  background: transparent;
  border: 0;
  color: var(--mist);
  font-size: 13px;
  outline: none;
}

.search-field__input::placeholder { color: rgba(159, 179, 200, 0.72); }

.search-field__hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--steel);
  border: 1px solid var(--line-soft);
  border-radius: 2px;
  padding: 1px 4px;
  flex: 0 0 auto;
}

/* nav */
.rail__nav { flex: 1 1 auto; }

.nav-list {
  display: grid;
  gap: 2px;
}

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

.nav-link {
  display: block;
  position: relative;
  padding: 9px 10px 9px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--steel);
  border-radius: 2px;
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}

.nav-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0;
  background: var(--cyan);
  transition: height 200ms var(--ease);
}

.nav-link:hover {
  color: var(--mist);
  background: rgba(159, 179, 200, 0.08);
}

.nav-link[aria-current="page"] {
  color: var(--mist);
  background: rgba(0, 229, 208, 0.1);
  font-weight: 700;
}

.nav-link[aria-current="page"]::before {
  height: 60%;
}

/* quick entries */
.rail__quick {
  display: grid;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.quick-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mist);
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--deep-1);
  transition: border-color 160ms var(--ease), color 160ms var(--ease), background-color 160ms var(--ease);
}

.quick-link::after {
  content: "→";
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--steel);
  transition: transform 160ms var(--ease), color 160ms var(--ease);
}

.quick-link:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.quick-link:hover::after {
  color: var(--cyan);
  transform: translateX(3px);
}

.quick-link--primary {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--deep-1);
  font-weight: 700;
}

.quick-link--primary::after { color: var(--deep-1); }

.quick-link--primary:hover {
  background: #ff8f5c;
  border-color: #ff8f5c;
  color: var(--deep-1);
}

.quick-link--primary:hover::after { color: var(--deep-1); }

/* nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--mist);
  transition: transform 200ms var(--ease), opacity 160ms var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.rail__scrim {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(4, 14, 24, 0.62);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

/* ----- breadcrumbs ----- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--steel);
}

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

.breadcrumbs__item + .breadcrumbs__item::before {
  content: "/";
  color: rgba(159, 179, 200, 0.5);
}

.breadcrumbs a:hover { color: var(--cyan); }

/* ----- grids ----- */
.grid {
  display: grid;
  gap: var(--gap);
}

.grid--12 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.grid--asymmetric {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}

.grid--asymmetric > .col-main { grid-column: span 8; }
.grid--asymmetric > .col-side { grid-column: span 4; }

/* ----- section band ----- */
.section-band {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-band--deep {
  background: var(--deep-2);
  border-color: var(--line-soft);
  padding: 28px 24px;
}

/* ----- mono label ----- */
.mono-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--cyan);
  border-left: 2px solid var(--cyan);
  padding-left: 10px;
  line-height: 1.4;
}

/* ----- tags ----- */
.tag-morandi {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  border-radius: 2px;
  background: var(--card);
  line-height: 1.6;
}

.tag-morandi--phone { background: var(--tag-phone); }
.tag-morandi--tablet { background: var(--tag-tablet); }
.tag-morandi--desktop { background: var(--tag-desktop); }
.tag-morandi--accessory { background: var(--tag-accessory); }

/* ----- buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), transform 160ms var(--ease);
}

.btn::after {
  content: "→";
  font-family: var(--font-mono);
  font-size: 13px;
  transition: transform 160ms var(--ease);
}

.btn:hover::after { transform: translateX(3px); }

.btn--primary {
  background: var(--orange);
  color: var(--deep-1);
}

.btn--primary:hover { background: #ff8f5c; }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--mist);
}

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

/* ----- section number ----- */
.section-no {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--mist);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 2px;
  letter-spacing: 0.06em;
  line-height: 1.6;
}

.section-no::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--cyan);
  flex: 0 0 auto;
}

/* ----- panels ----- */
.panel {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--deep-2);
  overflow: hidden;
}

.panel + .panel { margin-top: 8px; }

.panel__head {
  margin: 0;
}

.panel__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 14px 18px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--mist);
  letter-spacing: -0.01em;
}

.panel__trigger::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--cyan);
  transition: transform 200ms var(--ease);
}

.panel__trigger[aria-expanded="true"]::after {
  transform: rotate(45deg);
}

.panel__body {
  padding: 0 18px 18px;
  font-size: 15px;
  color: rgba(244, 247, 249, 0.82);
  max-width: 68ch;
}

.panel__body[hidden] { display: none; }

/* ----- figure / responsive image containers ----- */
.figure {
  position: relative;
  display: block;
  width: 100%;
  background: var(--deep-2);
  border: 1px solid var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.figure::before {
  content: "";
  display: block;
  padding-top: 66.66%;
}

.figure--wide::before { padding-top: 44%; }
.figure--square::before { padding-top: 100%; }
.figure--tall::before { padding-top: 130%; }

.figure__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* grid texture fallback for placeholders */
.figure__img:not([src]) {
  background-image:
    linear-gradient(to right, rgba(0, 229, 208, 0.16) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(159, 179, 200, 0.16) 1px, transparent 1px);
  background-size: 24px 24px;
}

.figure__caption {
  position: absolute;
  left: 0;
  bottom: 0;
  right: 0;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--mist);
  background: linear-gradient(to top, rgba(11, 34, 57, 0.9), transparent);
}

/* ----- reveal ----- */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 260ms var(--ease), transform 260ms var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ----- back to top ----- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--deep-1);
  background: var(--cyan);
  border-radius: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 200ms var(--ease), transform 200ms var(--ease), visibility 200ms;
}

.to-top::before { content: "↑"; font-size: 13px; }

.to-top.is-shown {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover { background: #3ff0de; }

/* ----- footer ----- */
.site-footer {
  position: relative;
  z-index: 1;
  background: #081a2c;
  border-top: 1px solid var(--line);
  color: var(--steel);
}

.site-footer__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 56px var(--pad-x) 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 40px 48px;
}

.site-footer__brand {
  display: grid;
  gap: 8px;
  align-content: start;
}

.site-footer__mark {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--mist);
  line-height: 1;
}

.site-footer__badge {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--cyan);
  border-left: 2px solid var(--cyan);
  padding-left: 8px;
}

.site-footer__note {
  font-size: 13px;
  line-height: 1.7;
  color: var(--steel);
  max-width: 30ch;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.footer__col { min-width: 0; }

.footer__title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--cyan);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.footer__list {
  display: grid;
  gap: 7px;
}

.footer__link {
  font-size: 14px;
  color: var(--steel);
  transition: color 160ms var(--ease);
}

.footer__link:hover { color: var(--cyan); }

.footer__link--inline {
  color: var(--mist);
  border-bottom: 1px solid rgba(0, 229, 208, 0.4);
}

.footer__contact {
  grid-column: 1 / -1;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
}

.footer__contact-line {
  font-size: 13px;
  line-height: 1.9;
  color: var(--steel);
  max-width: none;
}

.footer__update {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--cyan);
}

.footer__legal {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(159, 179, 200, 0.8);
}

.footer__icp,
.footer__copy { margin: 0; }

/* ================= responsive ================= */

@media (max-width: 1180px) {
  :root { --pad-x: 20px; --section-space: 72px; }
  .rail { padding: 24px 16px 18px; }
  .rail__mark { font-size: 26px; }
}

@media (max-width: 900px) {
  h1 { font-size: 36px; }
  h2 { font-size: 28px; }
  h3 { font-size: 22px; }

  .site-topbar { display: flex; }

  .site-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100%;
    width: min(320px, 86vw);
    padding: 24px 18px 24px;
    transform: translateX(-104%);
    transition: transform 240ms var(--ease);
    border-right: 1px solid var(--line);
    box-shadow: 0 0 40px rgba(4, 14, 24, 0.5);
    z-index: 80;
  }

  .rail[data-open="true"] { transform: none; }

  .rail__scrim[hidden] { display: none; }

  .rail__scrim.is-active {
    opacity: 1;
    display: block;
  }

  .nav-toggle { display: flex; }

  .content__inner {
    padding: 40px var(--pad-x) 64px;
  }

  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding-top: 44px;
  }

  .footer__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .grid--asymmetric > .col-main,
  .grid--asymmetric > .col-side {
    grid-column: span 12;
  }

  .to-top {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 640px) {
  h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  h3 { font-size: 20px; }
  h4 { font-size: 16px; }
  body { font-size: 15px; }

  .content__inner { padding: 28px 16px 56px; }

  .footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .site-footer__inner { padding: 36px 16px 28px; }
  .site-footer__mark { font-size: 26px; }
  .footer__contact-line { font-size: 12px; }

  .rail { width: min(300px, 90vw); }

  .breadcrumbs { font-size: 11px; margin-bottom: 20px; }
}

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

/* ----- reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

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

  .to-top {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
}
