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

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --c-green: #00ff80;
  --c-blue: #0000ff;
  --c-black: #000000;
  --c-white: #ffffff;
  --c-dark: #0a0a0a;
  --c-gray: #111111;
  --c-gray-mid: #222222;
  --c-text: #f0f0f0;
  --c-border: #00ff80;
  --border-w: 3px;
  --font-main: 'Noto Sans Thai', system-ui, sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
  --nav-h: 80px;
  --announce-h: 36px;
  --header-total: calc(var(--nav-h) + var(--announce-h));
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: var(--c-black);
  color: var(--c-text);
}

body {
  font-family: var(--font-main);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  background: var(--c-black);
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: var(--c-green);
  text-decoration: none;
}

a:hover, a:focus {
  color: var(--c-white);
  outline: 2px solid var(--c-green);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, menu {
  list-style: none;
}

/* ===== SCROLL MARGIN ===== */
section[id] {
  scroll-margin-top: calc(var(--header-total) + 16px);
}

/* ===== OVERLAY MENU ===== */
.overlay-menu {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--c-black);
  border: var(--border-w) solid var(--c-green);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateX(-100%);
  transition: none;
  visibility: hidden;
}

.overlay-menu.is-open {
  transform: translateX(0);
  visibility: visible;
}

.overlay-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: var(--border-w) solid var(--c-green);
  color: var(--c-green);
  font-size: 1.5rem;
  font-weight: 700;
  padding: 8px 16px;
  cursor: pointer;
  font-family: var(--font-main);
  min-height: 44px;
  min-width: 44px;
}

.overlay-close:hover {
  background: var(--c-green);
  color: var(--c-black);
}

.overlay-nav menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.overlay-nav menu li a {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--c-white);
  padding: 14px 40px;
  border: 2px solid transparent;
  border-left: 4px solid var(--c-blue);
  text-transform: none;
  letter-spacing: 0.02em;
  min-height: 44px;
}

.overlay-nav menu li a:hover,
.overlay-nav menu li a:focus {
  background: var(--c-blue);
  color: var(--c-green);
  border-color: var(--c-green);
  outline: none;
}

/* ===== HEADER ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 800;
  background: var(--c-black);
  border-bottom: var(--border-w) solid var(--c-green);
}

.header-announce {
  background: var(--c-blue);
  color: var(--c-green);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0 16px;
  height: var(--announce-h);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.08em;
  border-bottom: 2px solid var(--c-green);
  overflow: hidden;
}

.header-inner {
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: relative;
}

/* nav-details (brutalist structure requirement) */
.nav-details {
  position: relative;
}

.nav-details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 0;
}

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

.nav-toggle {
  background: none;
  border: none;
  color: var(--c-green);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.85rem;
}

.nav-toggle-label {
  display: none;
}

.nav-desktop-peek {
  display: none;
}

/* hamburger button */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: var(--border-w) solid var(--c-green);
  padding: 10px 14px;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  justify-content: center;
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-green);
}

.hamburger-btn:hover {
  background: var(--c-green);
}

.hamburger-btn:hover span {
  background: var(--c-black);
}

/* hamburger icon in summary */
.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 28px;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--c-green);
}

/* brand */
.header-brand {
  text-align: center;
  justify-self: center;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  outline: none;
}

.brand-link:focus {
  outline: 2px solid var(--c-green);
}

.brand-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--c-green);
  letter-spacing: 0.05em;
  text-shadow: 2px 2px 0 var(--c-blue);
}

.brand-logo {
  height: 48px;
  width: auto;
}

/* right nav */
.nav-split-right {
  justify-self: end;
}

.nav-split-right menu {
  display: flex;
  gap: 0;
}

.nav-split-right menu li a {
  display: block;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--c-text);
  border-left: 1px solid var(--c-gray-mid);
  min-height: 44px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.nav-split-right menu li a:hover,
.nav-split-right menu li a:focus {
  color: var(--c-green);
  background: var(--c-gray);
  outline: none;
}

/* hide right nav on mobile */
@media (max-width: 768px) {
  .nav-split-right {
    display: none;
  }

  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .nav-details {
    display: none;
  }

  .hamburger-btn {
    position: static;
    transform: none;
    margin-left: auto;
  }

  .header-inner {
    grid-template-columns: 1fr 44px;
    gap: 8px;
  }

  .header-brand {
    justify-self: start;
  }
}

/* ===== HERO ===== */
.hero-section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 80px;
  padding-top: var(--header-total);
  overflow: hidden;
}

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

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0,0,0,0.88) 0%,
    rgba(0,0,255,0.25) 50%,
    rgba(0,0,0,0.7) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 780px;
  padding: 0 48px;
}

.hero-badge {
  display: inline-block;
  background: var(--c-green);
  color: var(--c-black);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 6px 16px;
  margin-bottom: 24px;
  border: 2px solid var(--c-black);
}

.hero-h1 {
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--c-white);
  text-shadow: 4px 4px 0 var(--c-blue), 8px 8px 0 rgba(0,255,128,0.3);
  margin-bottom: 20px;
  border-left: 8px solid var(--c-green);
  padding-left: 20px;
}

.hero-desc {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  max-width: 560px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero-cta {
  display: inline-block;
  background: var(--c-green);
  color: var(--c-black);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 36px;
  border: 3px solid var(--c-black);
  min-height: 48px;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.hero-cta:hover,
.hero-cta:focus {
  background: var(--c-blue);
  color: var(--c-green);
  border-color: var(--c-green);
  outline: none;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 28px;
  right: 48px;
  z-index: 2;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c-green);
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
}

@media (max-width: 600px) {
  .hero-content {
    padding: 0 20px;
  }

  .hero-h1 {
    font-size: 2rem;
    border-left-width: 5px;
    padding-left: 12px;
  }

  .hero-scroll-hint {
    display: none;
  }
}

/* ===== MAIN / ARTICLE / ASIDE ===== */
.site-main {
  padding-top: 0;
}

.main-article {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
}

/* aside */
.content-aside {
  position: sticky;
  top: calc(var(--header-total) + 24px);
  padding: 0 0 40px 0;
  border-left: var(--border-w) solid var(--c-blue);
  background: var(--c-dark);
}

.aside-inner {
  padding: 24px 20px;
}

.aside-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--c-green);
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--c-gray-mid);
}

.aside-title span {
  display: inline-block;
}

.aside-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.aside-nav-list li a {
  display: block;
  padding: 9px 12px;
  font-size: 0.82rem;
  color: var(--c-text);
  border-left: 3px solid transparent;
  min-height: 40px;
  display: flex;
  align-items: center;
  line-height: 1.3;
}

.aside-nav-list li a:hover,
.aside-nav-list li a:focus {
  border-left-color: var(--c-green);
  background: var(--c-gray);
  color: var(--c-green);
  outline: none;
}

/* content section */
.content-section {
  border-right: var(--border-w) solid var(--c-gray-mid);
  min-width: 0;
}

/* ===== PAGE CONTENT SECTIONS ===== */
.content-section > section {
  padding: 72px 56px;
  border-bottom: var(--border-w) solid var(--c-gray-mid);
  position: relative;
}

.content-section > section:nth-child(even) {
  background: var(--c-dark);
}

.content-section > section:nth-child(odd) {
  background: var(--c-black);
}

/* Content typography */
.content-section h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--c-green);
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--c-blue);
  line-height: 1.2;
}

.content-section h2 span {
  display: inline;
}

.content-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-white);
  margin: 32px 0 14px;
  padding-left: 14px;
  border-left: 4px solid var(--c-green);
}

.content-section h3 span {
  display: inline;
}

.content-section p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-text);
  margin-bottom: 16px;
  max-width: 72ch;
}

.content-section ul,
.content-section ol {
  margin: 16px 0 20px 0;
  padding-left: 0;
  list-style: none;
}

.content-section ul li,
.content-section ol li {
  padding: 8px 0 8px 20px;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--c-text);
  border-bottom: 1px solid var(--c-gray-mid);
  position: relative;
}

.content-section ul li::before {
  content: '▶';
  position: absolute;
  left: 0;
  color: var(--c-green);
  font-size: 0.65rem;
  top: 11px;
}

.content-section ol {
  counter-reset: section-counter;
}

.content-section ol li {
  counter-increment: section-counter;
}

.content-section ol li::before {
  content: counter(section-counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  color: var(--c-blue);
  font-weight: 700;
  font-size: 0.8rem;
  top: 9px;
  font-family: var(--font-mono);
}

.content-section strong {
  color: var(--c-green);
  font-weight: 700;
}

.content-section em {
  color: rgba(255,255,255,0.75);
  font-style: italic;
}

.content-section blockquote {
  border-left: 6px solid var(--c-blue);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--c-gray-mid);
  font-style: italic;
  color: rgba(255,255,255,0.8);
}

.content-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.95rem;
}

.content-section table th {
  background: var(--c-blue);
  color: var(--c-green);
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  border: 2px solid var(--c-black);
}

.content-section table td {
  padding: 9px 14px;
  border: 1px solid var(--c-gray-mid);
  color: var(--c-text);
}

.content-section table tr:nth-child(even) td {
  background: var(--c-dark);
}

/* FAQ / details in content */
.content-section details {
  border: 2px solid var(--c-gray-mid);
  margin: 12px 0;
}

.content-section details summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 700;
  color: var(--c-green);
  list-style: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}

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

.content-section details summary::before {
  content: '+';
  margin-right: 10px;
  font-size: 1.2rem;
  color: var(--c-blue);
}

.content-section details[open] summary::before {
  content: '−';
}

.content-section details > *:not(summary) {
  padding: 14px 16px;
  border-top: 1px solid var(--c-gray-mid);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--c-dark);
  border-top: var(--border-w) solid var(--c-green);
  padding: 32px 48px;
  text-align: center;
}

.footer-copy {
  font-size: 0.9rem;
  color: var(--c-text);
  font-weight: 700;
  margin-bottom: 6px;
}

.footer-small {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  display: block;
}

/* ===== SCROLL REVEAL ===== */
@media (prefers-reduced-motion: no-preference) {
  .reveal-init {
    opacity: 0;
    transform: translateY(20px);
  }

  .revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal-init,
  .revealed {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 960px) {
  .main-article {
    grid-template-columns: 1fr;
  }

  .content-aside {
    position: static;
    border-left: none;
    border-bottom: var(--border-w) solid var(--c-blue);
    border-top: var(--border-w) solid var(--c-blue);
  }

  .aside-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .aside-nav-list li a {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .aside-nav-list li a:hover,
  .aside-nav-list li a:focus {
    border-left-color: transparent;
    border-bottom-color: var(--c-green);
  }

  .content-section {
    border-right: none;
  }

  .content-section > section {
    padding: 48px 28px;
  }

  .site-footer {
    padding: 28px 20px;
  }
}

@media (max-width: 600px) {
  .content-section > section {
    padding: 40px 16px;
  }

  .content-section h2 {
    font-size: 1.4rem;
  }

  .hero-section {
    align-items: center;
    padding-bottom: 40px;
  }

  .footer-copy {
    font-size: 0.82rem;
  }
}

/* ===== BRUTALIST ACCENT BLOCKS ===== */
.content-section > section::before {
  content: '';
  display: block;
  width: 48px;
  height: 4px;
  background: var(--c-blue);
  margin-bottom: 20px;
}

.content-section > section:nth-child(3n+1)::before {
  background: var(--c-green);
  width: 80px;
}

/* focus visible global */
:focus-visible {
  outline: 3px solid var(--c-green);
  outline-offset: 2px;
}

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