/* Phuket Confidential — article and section pages */
:root {
  --ink: #0b1013;
  --line: rgba(255, 255, 255, 0.08);
  --hover: rgba(255, 255, 255, 0.065);
  --card: rgba(255, 255, 255, 0.04);
  --soft: rgba(255, 255, 255, 0.74);
  --muted: rgba(255, 255, 255, 0.60);
  --accent: #ff4d6d;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(20px, 3.4vw, 52px);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ink); color: #fff;
  font-family: "Geist", "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 6px; }

/* Backdrop: the blurred hero image, same as the homepage once scrolled */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-blur {
  position: absolute; inset: 0;
  background: url("/assets/hero.webp") center 45% / cover no-repeat;
  filter: blur(32px) saturate(1.2); transform: scale(1.18);
}
.bg-scrim { position: absolute; inset: 0; background: var(--ink); opacity: 0.72; }

/* Reading progress (scroll-driven where supported) */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 30;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
}
@supports (animation-timeline: scroll()) {
  .progress { animation: grow linear both; animation-timeline: scroll(root); }
}
@keyframes grow { to { transform: scaleX(1); } }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: 72px; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: rgba(11, 16, 19, 0.55);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.logo img { height: 42px; width: auto; }
.topbar nav { display: flex; gap: 26px; font-size: 14.5px; color: var(--soft); }
.topbar nav a { transition: color 0.25s; }
.topbar nav a:hover { color: #fff; }
.cta {
  justify-self: end; height: 32px; padding: 0 15px; border-radius: 999px;
  background: #fff; color: #0b0f12; font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; transition: background 0.25s, transform 0.25s;
}
.cta:hover { background: #e9eef0; transform: translateY(-1px); }

/* Article */
.article { max-width: 720px; margin: 0 auto; padding: clamp(40px, 7vw, 88px) var(--gutter) 24px; }
.crumb { font-size: 13px; color: var(--muted); margin: 0 0 28px; }
.crumb a { border-bottom: 1px solid var(--line); }
.crumb a:hover { color: #fff; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
h1 { font-size: clamp(34px, 5.4vw, 60px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.02; margin: 0 0 18px; }
.dek { font-size: clamp(18px, 2.1vw, 22px); line-height: 1.45; color: var(--soft); margin: 0 0 24px; }
.meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); padding-bottom: 32px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.chip { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); }

.body { font-size: 18.5px; line-height: 1.6; color: rgba(255, 255, 255, 0.9); }
.body p { margin: 0 0 0.55em; }
.body p.lead-in { margin-top: 1.1em; color: #fff; }
.body h2 {
  font-size: clamp(22px, 2.6vw, 27px); font-weight: 500; letter-spacing: -0.01em; line-height: 1.2;
  margin: 2.2em 0 0.8em; color: #fff;
}
.verdict {
  margin: 2.6em 0 0.5em; padding: 26px 28px 20px; border-radius: 16px;
  background: rgba(255, 77, 109, 0.08); border: 1px solid rgba(255, 77, 109, 0.28);
}
.verdict-label { font-size: 12px !important; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px !important; }
.verdict p:last-child { margin-bottom: 0; color: #fff; }

/* After the article: retention block (strategy 9.4) */
.after { max-width: 720px; margin: 0 auto; padding: 40px var(--gutter) 80px; display: flex; flex-direction: column; gap: 16px; }
.next-card, .rel-card {
  display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line); transition: background 0.25s, border-color 0.25s;
}
.next-card:hover, .rel-card:hover { background: var(--hover); border-color: rgba(255, 255, 255, 0.18); }
.next-card { padding: 30px; border-color: rgba(255, 255, 255, 0.16); }
.next-card strong { font-size: clamp(24px, 3vw, 32px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.rel-card strong { font-size: 19px; font-weight: 500; line-height: 1.2; }
.k { font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin: 0; }
.x { font-size: 15px; line-height: 1.5; color: var(--soft); }
.m { font-size: 13px; color: var(--muted); }
.rel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cta-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 24px; border-radius: 16px; border: 1px solid var(--line);
}
.cta-row p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--soft); }
.cta-row .k { margin-bottom: 6px; }
.btn {
  flex: none; height: 40px; padding: 0 18px; border-radius: 999px; background: #fff; color: #0b0f12;
  display: inline-flex; align-items: center; font-size: 14px; font-weight: 500; white-space: nowrap;
}
.btn.ghost { background: none; color: #fff; border: 1px solid rgba(255, 255, 255, 0.24); }
.btn.ghost:hover { background: var(--hover); }

/* Section index pages */
.index { max-width: 880px; padding-bottom: 80px; }
.list { border-top: 1px solid var(--line); margin-top: 12px; }
.list-row {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: baseline;
  padding: 24px 4px; border-bottom: 1px solid var(--line); transition: background 0.25s;
}
.list-row:hover { background: var(--hover); }
.list-row .n { color: var(--muted); font-size: 14px; }
.list-row strong { display: block; font-size: 21px; font-weight: 500; letter-spacing: -0.01em; }
.list-row em { display: block; font-style: normal; color: var(--soft); font-size: 15px; line-height: 1.5; margin-top: 6px; }
.list-row .m { white-space: nowrap; }

.footer {
  padding: 40px var(--gutter); border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted);
}
.footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
.footer a:hover { color: #fff; }

@media (max-width: 860px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar nav { display: none; }
  .rel-grid { grid-template-columns: 1fr; }
  .cta-row { flex-direction: column; align-items: flex-start; }
  .list-row { grid-template-columns: 36px 1fr; }
  .list-row .m { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .progress { display: none; }
}

/* ---------- Section sub-navigation (mobile + quick jumps) ---------- */
.subnav {
  display: none; gap: 8px; overflow-x: auto; padding: 10px var(--gutter);
  border-bottom: 1px solid var(--line); background: rgba(11, 16, 19, 0.6);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  scrollbar-width: none; position: sticky; top: 72px; z-index: 19;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a { flex: none; font-size: 13.5px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--soft); }
@media (max-width: 860px) { .subnav { display: flex; } }

/* ---------- Wider layout for archive / series / lists ---------- */
.article.wide { max-width: 1180px; }
.article.wide .dek { max-width: 680px; }

/* ---------- Confidential File page ---------- */
.hero-fig { margin: 0 0 36px; position: relative; }
.hero-fig img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); }
.hero-fig figcaption { position: absolute; right: 12px; bottom: 10px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.7); background: rgba(0,0,0,0.45); padding: 3px 8px; border-radius: 999px; }
.body.story p { margin: 0 0 1.05em; }
.body.story p:first-child::first-letter {
  float: left; font-size: 3.4em; line-height: 0.82; padding: 6px 10px 0 0; font-weight: 500; color: var(--accent);
}
.end-mark { margin: 40px 0 0; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.end-mark::before { content: ""; width: 10px; height: 10px; background: var(--accent); border-radius: 2px; }
a.chip:hover { background: var(--hover); color: #fff; }

/* ---------- File cards ---------- */
.fcard {
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); transition: background 0.25s, border-color 0.25s, transform 0.4s var(--ease);
}
.fcard:hover { background: var(--hover); border-color: rgba(255,255,255,0.18); transform: translateY(-2px); }
.fcard img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.fc-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; }
.fcard strong { font-size: 19px; font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
.fcard.big { flex-direction: row; }
.fcard.big img { width: 46%; aspect-ratio: auto; min-height: 220px; }
.fcard.big .fc-body { justify-content: center; padding: 26px 28px; }
.fcard.big strong { font-size: clamp(24px, 3vw, 30px); letter-spacing: -0.02em; }
.rel-card.big { padding: 30px; border-color: rgba(255,255,255,0.16); }
.rel-card.big strong { font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.02em; line-height: 1.1; }

.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.fgrid.three { margin-top: 12px; }
.fgrid.list-mode { grid-template-columns: repeat(2, 1fr); }
.fwrap[hidden] { display: none; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.filter {
  font: inherit; font-size: 13.5px; color: var(--soft); background: none; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); transition: background 0.2s, color 0.2s;
}
.filter:hover { background: var(--hover); }
.filter.on { background: #fff; color: #0b0f12; border-color: #fff; }
.files-on { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }

/* ---------- Series strip at the end of a File ---------- */
.series-strip { padding: 24px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.series-strip ol { list-style: none; margin: 14px 0 16px; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.series-strip li a { display: flex; gap: 14px; padding: 9px 10px; border-radius: 9px; font-size: 15px; color: var(--soft); transition: background 0.2s; }
.series-strip li a:hover { background: var(--hover); color: #fff; }
.series-strip li.here a { background: var(--hover); color: #fff; }
.series-strip .n { color: var(--muted); font-variant-numeric: tabular-nums; width: 40px; flex: none; }
.more { font-size: 14px; color: var(--soft); border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.more:hover { color: #fff; }

/* ---------- Series index ---------- */
.series-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 28px; }
.series-tile { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--card); transition: background 0.25s, transform 0.4s var(--ease); }
.series-tile:hover { background: var(--hover); transform: translateY(-2px); }
.series-tile img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.series-tile > span { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px 24px; }
.series-tile strong { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; }
.series-tile em { font-style: normal; color: var(--soft); font-size: 15px; line-height: 1.5; }
.article.wide .btn { margin-bottom: 4px; }

/* ---------- Start Here path ---------- */
.start-path { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: s; }
.start-path a {
  display: grid; grid-template-columns: 220px 1fr; gap: 22px; align-items: center; padding: 14px;
  border-radius: 16px; border: 1px solid var(--line); background: var(--card); transition: background 0.25s;
}
.start-path a:hover { background: var(--hover); }
.start-path img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; }
.start-path li { counter-increment: s; }
.start-path a > span { display: flex; flex-direction: column; gap: 6px; }
.start-path .k::before { content: counter(s, decimal-leading-zero) " · "; }
.start-path strong { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.start-path em { font-style: normal; color: var(--soft); font-size: 15px; line-height: 1.5; }

/* ---------- Field Notes ---------- */
.notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.note { padding: 22px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 100px; }
.note:target { border-color: var(--accent); }
.note .stamp { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.note p { font-size: 16px; line-height: 1.55; margin: 0; color: rgba(255,255,255,0.9); }
.note .share { margin-top: auto; font-size: 13px; color: var(--muted); }
.note .share:hover { color: #fff; }

/* ---------- Prose pages (About etc.) ---------- */
.prose p, .prose li { font-size: 17.5px; line-height: 1.65; }
.prose p { margin: 0 0 1em; }
.prose ul { padding-left: 1.2em; margin: 0 0 1.2em; }
.prose li { margin-bottom: 0.5em; }
.prose a { border-bottom: 1px solid rgba(255,255,255,0.35); }
.prose a:hover { border-color: #fff; }
.table-wrap { overflow-x: auto; margin: 0 0 1.4em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 500; color: var(--muted); font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }

@media (max-width: 1000px) {
  .fgrid, .notes-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .fgrid, .fgrid.list-mode, .notes-grid, .series-tiles { grid-template-columns: 1fr; }
  .fcard.big { flex-direction: column; }
  .fcard.big img { width: 100%; min-height: 0; aspect-ratio: 16 / 10; }
  .start-path a { grid-template-columns: 1fr; }
}

/* ---------- Explainer images ---------- */
.rel-card.has-img { overflow: hidden; padding-top: 0; }
.rel-card.has-img img { width: calc(100% + 48px); margin: 0 -24px 8px; aspect-ratio: 16 / 9; object-fit: cover; }
.rel-card.big.has-img img { width: calc(100% + 60px); margin: 0 -30px 10px; }
.list-row.has-img { grid-template-columns: 140px 1fr auto; align-items: center; }
.list-row.has-img img { width: 140px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; }
@media (max-width: 860px) {
  .list-row.has-img { grid-template-columns: 96px 1fr; }
  .list-row.has-img img { width: 96px; }
}

/* Imported Files: link back to the original social post */
.origin { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.origin a { color: #fff; border-bottom: 1px solid rgba(255,255,255,0.35); }

/* ---------- Survival Guide page ---------- */
.g-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.g-step { display: grid; grid-template-columns: 44px 1fr; gap: 18px; padding: 22px 24px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.g-n { font-size: 15px; font-weight: 500; color: var(--accent); font-variant-numeric: tabular-nums; padding-top: 2px; }
.g-step .k { margin-bottom: 8px; }
.body .g-step h2 { margin: 0 0 8px; }
.body .g-step p:not(.k) { margin: 0; }
.body .g-step p.g-tip { margin-top: 12px; font-size: 15px; color: var(--soft); display: flex; gap: 8px; }
.g-tip::before { content: "→"; color: var(--accent); }
.verdict strong { font-weight: 500; }
.g-carousel { margin: 48px 0 0; }
.g-carousel .k { margin-bottom: 14px; }
.g-slides { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; scrollbar-width: thin; }
.g-slides img { flex: none; width: min(68%, 260px); height: auto; aspect-ratio: 4 / 5; border-radius: 12px; border: 1px solid var(--line); scroll-snap-align: start; }
.g-sources { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.6; color: var(--muted); }
.g-sources .k { margin-bottom: 8px; }
.g-sources ul { margin: 0 0 16px; padding-left: 1.1em; }
.g-sources a { color: var(--soft); border-bottom: 1px solid var(--line); }
.g-sources a:hover { color: #fff; }
.g-sources p { margin: 0; }
@media (max-width: 680px) {
  .g-step { grid-template-columns: 1fr; gap: 6px; padding: 20px; }
}

/* ---------- Field Guide page ---------- */
.body.fg p { margin: 0 0 1em; }
.body.fg .fg-lead { font-size: 1.08em; color: #fff; font-weight: 500; line-height: 1.5; }
.body ul, .body ol { margin: 0 0 1.1em; padding-left: 1.25em; }
.body li { margin: 0 0 .55em; }
.body ol li::marker { color: var(--accent); font-weight: 500; }
.body ul li::marker { color: var(--accent); }
.fg-map { margin: 2.4em 0 0; padding: 24px 26px 22px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.fg-map .k { margin-bottom: 14px; }
.fg-map dl { margin: 0; display: grid; gap: 12px; }
.fg-map dl div { display: grid; grid-template-columns: 120px 1fr; gap: 14px; }
.fg-map dt { font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.fg-map dd { margin: 0; font-size: 15.5px; line-height: 1.5; color: rgba(255,255,255,.9); }
.fg-insider { margin: 18px 0 0; padding: 14px 16px; border-radius: 12px; background: rgba(255,77,109,.08); border: 1px solid rgba(255,77,109,.28); font-size: 16px; font-weight: 500; }
.fg-fine { margin: 22px 0 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
.fg-fine a { color: var(--soft); border-bottom: 1px solid var(--line); }
.fg-area { margin: 36px 0 4px; font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
@media (max-width: 680px) { .fg-map dl div { grid-template-columns: 1fr; gap: 2px; } }

/* "See it on the map" links */
.fg-maplink { margin-top: 16px; }
.g-maplink { margin: 28px 0 0; }
/* /guides/: one section, area guides then checklists */
.g-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.g-jump .chip { color: var(--soft); }
.g-jump .chip.map { border-color: rgba(255,77,109,.45); color: #fff; }
.g-kind { margin: 26px 0 -14px; font-size: 13.5px; color: var(--muted); }
.fg-area + .g-kind { margin: 6px 0 0; }
.fg-area { scroll-margin-top: 90px; }
/* a File's area opens the map there */
.meta a.chip.map { border-color: rgba(255,77,109,.45); color: #fff; display: inline-flex; align-items: center; gap: 6px; }
.meta a.chip.map::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 8px #ff4d6d; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* 404 */
.nf h1 { font-size: clamp(34px, 5vw, 56px); }
.nf-go { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 40px; }
.nf-k { margin: 0 0 14px; }
/* the map link carries the site's live dot everywhere */
.map-link { display: inline-flex; align-items: center; gap: 7px; }
.map-link i { width: 6px; height: 6px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 0 3px rgba(255,77,109,.18), 0 0 10px #ff4d6d; animation: mapDot 2.4s ease-in-out infinite; }
@keyframes mapDot { 0%, 100% { transform: scale(.85); opacity: .7; } 50% { transform: scale(1.15); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .map-link i { animation: none; } }
.note-acts { display: flex; gap: 16px; align-items: center; }
.note-map { font-size: 13px; color: var(--muted, rgba(255,255,255,.6)); display: inline-flex; align-items: center; gap: 6px; }
.note-map::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 8px #ff4d6d; }
.note-map:hover { color: #fff; }
