/* Foundation */
:root {
  --ink: #08111f;
  --paper: #f1f0e8;
  --paper-strong: #fffdf4;
  --muted: #aab4bf;
  --line: rgba(236, 239, 228, 0.18);
  --gold: #f2c86b;
  --mint: #77d2c2;
  --coral: #d65050;
  --max: 1180px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--ink);
  color: var(--paper);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  z-index: 20;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .22em; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

.shell { width: min(calc(100% - 2.5rem), var(--max)); margin-inline: auto; }

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

.site-page > main > .section:first-child {
  padding-top: clamp(3rem, 6vw, 5rem);
}

.eyebrow { margin: 0 0 1rem; color: var(--gold); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 750; }
.page-hero h1 {
  max-width: 12ch;
  margin: 0;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(3.6rem, 9.7vw, 8.6rem);
  font-weight: 500;
  line-height: .94;
  letter-spacing: -.055em;
}
.actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.button {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  min-height: 46px;
  padding: .72rem 1rem;
  border: 1px solid var(--paper);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  background: var(--paper);
  color: var(--ink);
}
.button:hover { background: var(--gold); border-color: var(--gold); }
.button.secondary { background: transparent; color: var(--paper); border-color: var(--line); }
.button.secondary:hover { border-color: var(--mint); color: var(--mint); }

.section { padding: clamp(5rem, 10vw, 9rem) 0; }
.prose h2 {
  margin: 0;
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-weight: 500;
  font-size: clamp(2.3rem, 5vw, 4.6rem);
  line-height: 1.05;
  letter-spacing: -.035em;
}
.number { color: var(--mint); font-variant-numeric: tabular-nums; letter-spacing: .12em; font-size: .78rem; }

/* Standalone pages */
.page-hero { min-height: 56vh; display: flex; align-items: end; padding: 11rem 0 5rem; border-bottom: 1px solid var(--line); background: #0e1b2a; position: relative; overflow: hidden; }
.page-hero::after { content: attr(data-index); position: absolute; right: -1rem; bottom: -4rem; font: 16rem/.8 Georgia, serif; color: rgba(255,255,255,.035); }
.page-hero h1 { font-size: clamp(3.8rem, 9vw, 8rem); max-width: 13ch; }
.compact-hero { min-height: 38vh; padding-top: 9rem; padding-bottom: 3rem; }
.compact-hero h1 { font-size: clamp(3rem, 7vw, 6rem); }
.page-lead { max-width: 48rem; color: #c4ccd1; font-size: 1.18rem; margin: 1.5rem 0 0; }
.prose { max-width: 760px; }
.prose p, .prose li { color: #c9d0d3; }
.prose h2 { font-size: clamp(2rem, 4vw, 3.5rem); margin-top: 3.5rem; }

/* Photography */
.gallery-grid { columns: 3; column-gap: 1rem; }
.gallery-item { margin: 0 0 1rem; display: block; width: 100%; border: 0; padding: 0; background: #0d1927; cursor: zoom-in; overflow: hidden; }
.gallery-item img { width: 100%; transition: transform .45s ease, opacity .45s ease; }
.gallery-item:hover img { transform: scale(1.025); opacity: .84; }
.lightbox { border: 0; padding: 0; background: #03070c; color: var(--paper); width: min(92vw, 1100px); }
.lightbox::backdrop { background: rgba(1, 4, 8, .9); }
.lightbox figure { margin: 0; }
.lightbox img { max-height: 82vh; width: 100%; object-fit: contain; }
.lightbox footer { display: flex; justify-content: space-between; align-items: center; padding: 1rem; }
.lightbox button { background: transparent; border: 1px solid var(--line); color: var(--paper); padding: .5rem .8rem; cursor: pointer; }

/* Video */
.video-list { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem 1.2rem; }
.video-item video { width: 100%; aspect-ratio: 16 / 9; background: #02060b; object-fit: cover; }
.video-item h2 { margin: 1rem 0 .25rem; font-family: Georgia, serif; font-weight: 500; }
.video-item p { color: var(--muted); margin: 0; }

.callout { border: 1px solid var(--line); padding: clamp(1.5rem, 4vw, 3rem); margin: 3rem 0; background: #0f1b29; }
.callout strong { color: var(--gold); }

/* VPN */
.status-panel { display: flex; align-items: center; gap: 1.2rem; padding: 1.25rem 1.4rem; border: 1px solid rgba(119, 210, 194, .35); background: #0d1b25; }
.status-panel strong { color: var(--mint); font-size: 1.1rem; }
.status-panel p { margin: .15rem 0 0; color: var(--muted); }
.status-light { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 6px rgba(119, 210, 194, .13), 0 0 24px rgba(119, 210, 194, .6); }
.vpn-block { margin-top: clamp(3rem, 6vw, 4.5rem); }
.vpn-heading { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(320px, 1.3fr); align-items: end; gap: 2rem; margin-bottom: 1.5rem; }
.vpn-heading h2 { margin: .2rem 0 0; font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: clamp(1.8rem, 3vw, 2.25rem); font-weight: 500; line-height: 1.15; letter-spacing: -.02em; }
.vpn-heading > p { max-width: 39rem; margin: 0; justify-self: end; color: var(--muted); }
.download-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.download-card { min-height: 155px; display: flex; flex-direction: column; justify-content: space-between; padding: 1.25rem; border: 1px solid var(--line); background: #0d1927; text-decoration: none; }
.download-card:hover { border-color: var(--gold); background: #111f2e; }
.download-card span { color: var(--gold); font-size: .78rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.download-card strong { font-size: 1.25rem; line-height: 1.25; }
.download-card small { color: var(--muted); }
.vpn-setup { padding-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line); }
.vpn-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; gap: 1rem; list-style: none; }
.vpn-steps li { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 1rem; min-width: 0; padding: 1.25rem; border: 1px solid var(--line); background: #0d1927; }
.vpn-steps li > span { color: var(--gold); font-size: .78rem; font-weight: 750; letter-spacing: .12em; }
.vpn-steps strong { color: var(--paper); font-size: 1.05rem; }
.vpn-steps p { margin: .35rem 0 0; color: var(--muted); font-size: .94rem; line-height: 1.65; }

/* Domain email */
.email-section { background: #fff; color: #5f5f5f; min-height: 650px; }
.email-page-title { margin: 0; color: #333; text-align: center; font-size: clamp(1.55rem, 3vw, 2.35rem); font-weight: 500; line-height: 1.35; }
.email-page-title::after { content: ""; display: block; width: 10%; min-width: 72px; height: 1px; margin: 28px auto 58px; background: #d65050; }
.email-layout { display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: clamp(3rem, 7vw, 7rem); }
.email-copy img { width: min(100%, 720px); margin: 0 auto; }
.email-login { width: min(100%, 390px); justify-self: center; padding: clamp(2rem, 4vw, 3rem); border: 1px solid #d7d1c1; background: var(--paper); color: var(--ink); box-shadow: 18px 18px 0 rgba(242, 200, 107, .24); }
.email-login h2 { margin: 0 0 1.8rem; padding-bottom: 1rem; border-bottom: 2px solid var(--gold); font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(2rem, 4vw, 3rem); font-weight: 500; line-height: 1; }
.email-login label { display: block; margin: 1.25rem 0 .4rem; font-weight: 750; }
.email-login input[type="text"], .email-login input[type="password"] { width: 100%; min-width: 0; border: 1px solid #a8adb0; background: var(--paper-strong); color: var(--ink); padding: .78rem; }
.email-login input:focus { border-color: #8a661d; outline: 2px solid rgba(242, 200, 107, .4); outline-offset: 1px; }
.mail-user-field { display: flex; align-items: center; border: 1px solid #a8adb0; background: var(--paper-strong); }
.mail-user-field:focus-within { border-color: #8a661d; outline: 2px solid rgba(242, 200, 107, .4); outline-offset: 1px; }
.mail-user-field input[type="text"] { border: 0; }
.mail-user-field input[type="text"]:focus { outline: 0; }
.mail-user-field span { padding-right: .8rem; color: #59646c; white-space: nowrap; }
.email-login .button { min-width: 118px; justify-content: center; margin-top: 1.7rem; border-color: var(--ink); background: var(--ink); color: var(--paper); }
.email-login .button:hover { border-color: var(--gold); background: var(--gold); color: var(--ink); }
.email-help { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.3rem; font-size: .88rem; }
.email-help a { color: #b73d3d; }

/* Fashion calculator */
.fashion-app { margin-top: 2rem; }
.dataset-switch { display: flex; gap: .75rem; margin-bottom: 1rem; }
.dataset-switch button { border: 1px solid var(--line); background: transparent; color: var(--paper); padding: .65rem 1rem; cursor: pointer; }
.dataset-switch button[aria-pressed="true"] { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.data-status { color: var(--muted); min-height: 1.7em; }
.data-status[data-error] { color: var(--coral); }
.filter-panel { border: 1px solid var(--line); padding: clamp(1.2rem, 3vw, 2.2rem); margin: 2rem 0; }
.attribute-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .7rem; border: 0; padding: 0; margin: 0 0 1.5rem; }
.attribute-grid legend { margin-bottom: 1rem; font-weight: 750; }
.attribute-grid label { display: flex; align-items: center; gap: .5rem; color: #d1d7da; }
.attribute-grid input { accent-color: var(--gold); width: 1.1rem; height: 1.1rem; }
.filter-options { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.filter-options select { background: var(--ink); color: var(--paper); border: 1px solid var(--line); padding: .55rem; }
.fashion-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 1rem; }
.result-group { min-width: 0; margin: 0; padding: 1rem; border: 1px solid var(--line); background: #0d1927; }
.result-heading { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--paper); }
.result-heading h2 { margin: 0 0 .45rem; font-family: Georgia, "Noto Serif SC", serif; font-size: 1.3rem; font-weight: 500; }
.result-heading span { color: var(--muted); }
.result-group ol { list-style: none; padding: 0; margin: 0; }
.result-group li { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .55rem; padding: .5rem 0; border-bottom: 1px solid var(--line); align-items: baseline; font-size: .9rem; }
.result-group li > span:nth-child(2) { overflow-wrap: anywhere; }
.result-group li > b { color: var(--gold); font-variant-numeric: tabular-nums; font-size: 1rem; }
.rank { color: #6e7a84; font-variant-numeric: tabular-nums; }
.result-detail { display: block; color: var(--muted); font-size: .75rem; font-weight: 400; }
.empty-state { color: var(--muted); border-top: 1px solid var(--line); padding: 2rem 0; }

.fashion-section { background: #fff; color: #555; }
.fashion-intro { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: center; gap: clamp(2.5rem, 6vw, 6rem); max-width: 1080px; margin: 0 auto 52px; }
.fashion-intro-copy { text-align: left; }
.fashion-kicker { margin: 0 0 14px !important; color: #8a661d !important; font-size: .78rem !important; font-weight: 750; letter-spacing: .16em; }
.fashion-intro h1 { margin: 0; color: #222; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(2rem, 4vw, 3.65rem); font-weight: 500; line-height: 1.12; }
.fashion-intro-copy > p:not(.fashion-kicker) { margin: 18px 0 0; color: #777; font-size: 1.05rem; }
.fashion-intro img { width: 100%; max-height: 470px; object-fit: cover; object-position: center; box-shadow: 18px 18px 0 rgba(8, 17, 31, .1); }
.fashion-divider { width: 76px; height: 2px; margin: 30px 0; background: #d65050; }
.fashion-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; color: #777; }
.fashion-counts span { display: flex; flex-direction: column; align-items: flex-start; }
.fashion-counts strong { color: #b73d3d; font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 500; line-height: 1.1; }
.fashion-section .dataset-switch button { border-color: #bbb; color: #555; }
.fashion-section .dataset-switch button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--gold); }
.fashion-section .data-status,
.fashion-section .result-heading span,
.fashion-section .result-detail,
.fashion-section .empty-state { color: #777; }
.fashion-section .filter-panel { border-color: #ddd; background: #fafafa; }
.fashion-section .attribute-grid label { color: #555; }
.fashion-section .attribute-grid input { accent-color: #8a661d; }
.fashion-section .filter-options select { border-color: #bbb; background: #fff; color: #444; }
.fashion-section .filter-options .button { border-color: var(--ink); background: var(--ink); color: var(--gold); }
.fashion-section .filter-options .button.secondary { border-color: #aaa; background: #fff; color: #555; }
.fashion-section .result-group { border-color: #ddd; background: #fff; }
.fashion-section .result-heading { border-bottom-color: #d65050; }
.fashion-section .result-heading h2 { color: #333; }
.fashion-section .result-group li { border-bottom-color: #e4e4e4; }
.fashion-section .result-group li > b { color: #b73d3d; }

/* About page */
.about-section { min-height: 560px; background: #fff; color: #767676; }
.about-section .prose { max-width: 1170px; }
.about-section h1 { margin: 0 0 28px; color: #333; font-size: 32px; font-weight: 600; }
.about-section p { max-width: 780px; color: #767676; }

@media (max-width: 900px) {
  .vpn-heading { grid-template-columns: 1fr; gap: .75rem; }
  .vpn-heading > p { justify-self: start; }
  .email-layout, .fashion-intro { grid-template-columns: 1fr; }
  .gallery-grid { columns: 2; }
  .attribute-grid { grid-template-columns: repeat(2, 1fr); }
  .download-grid, .fashion-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fashion-intro { max-width: 720px; gap: 2.5rem; }
  .fashion-intro img { max-height: none; }
}

@media (max-width: 600px) {
  .shell { width: min(calc(100% - 1.5rem), var(--max)); }
  .video-list, .download-grid, .fashion-results { grid-template-columns: 1fr; }
  .vpn-steps { grid-template-columns: 1fr; }
  .gallery-grid { columns: 1; }
  .filter-options { align-items: stretch; flex-direction: column; }
  .filter-options .button { justify-content: center; }
  .email-help { flex-direction: column; }
  .mail-user-field span { font-size: .85rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
