/* =========================================================
   ROBOTIKA SMA NEGERI 1 BABAT — DESIGN TOKENS
   Konsep: "Lembar Skematik" — kisi biru cetak biru (blueprint),
   aksen tembaga sirkuit, blok judul ala gambar teknik.
   ========================================================= */
:root {
  /* Warna */
  --navy-900: #0f1f38;
  --navy-800: #16294a;
  --navy-700: #1e3a5f;
  --paper: #f6f4ec;
  --paper-dim: #ece8db;
  --line-on-paper: rgba(15, 31, 56, 0.12);
  --line-on-navy: rgba(246, 244, 236, 0.14);
  --copper: #c1793a;
  --copper-light: #e0a15f;
  --copper-dark: #8f5a29;
  --sage: #4c7c59;
  --ink: #16233a;
  --ink-soft: #45526b;
  --white: #ffffff;
  --danger: #b5473a;

  /* Tipografi */
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  /* Tata letak */
  --max-w: 1180px;
  --radius: 4px;
  --nav-h: 76px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--navy-900);
}

p { margin: 0; line-height: 1.65; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper-dark);
}

.mono-label::before { content: "// "; color: var(--copper); }

/* Focus visibility (aksesibilitas) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

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

/* =========================================================
   NAVBAR
   ========================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(246, 244, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-on-paper);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

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

.brand-text strong {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--navy-900);
}

.brand-text span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--copper-dark);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  position: relative;
  padding: 6px 0;
}

.nav-links a:hover { color: var(--navy-900); }

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--copper);
  transition: width 0.25s ease;
}

.nav-links a:hover::after { width: 100%; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  padding: 11px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--copper);
  color: var(--white);
}
.btn-primary:hover { background: var(--copper-dark); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border-color: var(--navy-900);
  color: var(--navy-900);
}
.btn-outline:hover { background: var(--navy-900); color: var(--paper); }

.btn-ghost-paper {
  background: transparent;
  border-color: var(--line-on-navy);
  color: var(--paper);
}
.btn-ghost-paper:hover { background: rgba(246,244,236,0.1); }

.nav-cta { display: flex; align-items: center; gap: 14px; }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--navy-900);
  border-radius: var(--radius);
  width: 42px;
  height: 42px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--navy-900);
  position: relative;
}
.menu-toggle span::before { position: absolute; top: -6px; }
.menu-toggle span::after { position: absolute; top: 6px; }

/* =========================================================
   HERO — "LEMBAR SKEMATIK"
   ========================================================= */
.hero {
  position: relative;
  background: var(--navy-900);
  color: var(--paper);
  overflow: hidden;
  background-image:
    linear-gradient(var(--line-on-navy) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-on-navy) 1px, transparent 1px);
  background-size: 44px 44px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 15% 10%, rgba(193,121,58,0.16), transparent 55%),
              radial-gradient(ellipse at 85% 90%, rgba(76,124,89,0.14), transparent 55%);
  pointer-events: none;
}

.hero-sheet {
  position: relative;
  margin: 40px 0 0;
  padding-top: 64px;
  padding-bottom: 40px;
}

.corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 2px solid var(--copper);
}
.corner-tl { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.corner-tr { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.corner-bl { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.corner-br { bottom: 12px; right: 12px; border-left: none; border-top: none; }

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  padding: 20px 0 56px;
}

.hero-copy .mono-label { color: var(--copper-light); }
.hero-copy .mono-label::before { color: var(--copper-light); }

.hero-title {
  margin-top: 14px;
  font-size: clamp(38px, 5.2vw, 64px);
  line-height: 1.04;
  color: var(--paper);
}
.hero-title .accent { color: var(--copper-light); }

.hero-desc {
  margin-top: 20px;
  max-width: 46ch;
  color: rgba(246,244,236,0.78);
  font-size: 16.5px;
}

.hero-actions {
  margin-top: 32px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-stats {
  margin-top: 44px;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.hero-stat strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 26px;
  color: var(--copper-light);
}
.hero-stat span {
  font-size: 12px;
  color: rgba(246,244,236,0.6);
  letter-spacing: 0.04em;
}

/* Diagram sirkuit animasi (elemen ciri khas) */
.hero-diagram {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 460px;
  justify-self: center;
}

.hero-diagram svg { width: 100%; height: 100%; }

.trace {
  fill: none;
  stroke: var(--copper);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 6 5000;
  animation: draw 3.2s ease-in-out forwards;
}
.trace.trace-sage { stroke: var(--sage); animation-delay: 0.3s; }
.trace.trace-light { stroke: var(--copper-light); animation-delay: 0.6s; }

@keyframes draw {
  to { stroke-dasharray: 5000 0; }
}

.node {
  fill: var(--navy-900);
  stroke: var(--copper-light);
  stroke-width: 2;
}
.node-label {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: rgba(246,244,236,0.75);
  letter-spacing: 0.06em;
}

.title-block {
  position: relative;
  margin-top: 8px;
  border-top: 1px solid var(--line-on-navy);
  padding-top: 18px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(246,244,236,0.55);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.title-block b { color: var(--copper-light); font-weight: 600; }

/* =========================================================
   SECTION SHELL
   ========================================================= */
section { padding: 96px 0; }

.section-head {
  max-width: 640px;
  margin-bottom: 52px;
}
.section-head h2 {
  margin-top: 12px;
  font-size: clamp(28px, 3.4vw, 40px);
}
.section-head p {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 16px;
}

.section-alt { background: var(--paper-dim); }
.section-dark {
  background: var(--navy-900);
  color: var(--paper);
}
.section-dark h2, .section-dark h3 { color: var(--paper); }
.section-dark .section-head p { color: rgba(246,244,236,0.7); }

/* =========================================================
   TENTANG
   ========================================================= */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.about-copy p + p { margin-top: 16px; color: var(--ink-soft); }

.about-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.about-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
  color: var(--ink-soft);
}
.about-list li::before {
  content: "";
  flex: none;
  width: 9px; height: 9px;
  margin-top: 6px;
  background: var(--copper);
  transform: rotate(45deg);
}

.spec-card {
  background: var(--white);
  border: 1px solid var(--line-on-paper);
  border-radius: var(--radius);
  padding: 28px;
}
.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line-on-paper);
  font-size: 14.5px;
}
.spec-row:last-child { border-bottom: none; }
.spec-row .k { color: var(--ink-soft); }
.spec-row .v { font-family: var(--font-mono); font-weight: 600; color: var(--navy-900); }

/* =========================================================
   PROGRAM / KEGIATAN
   ========================================================= */
.program-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.program-card {
  background: var(--white);
  border: 1px solid var(--line-on-paper);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.program-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(15,31,56,0.08);
}

.program-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--copper);
}

.program-card h3 {
  margin-top: 14px;
  font-size: 19px;
}

.program-card p {
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.program-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--paper-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.program-icon svg { width: 22px; height: 22px; stroke: var(--navy-900); }

/* =========================================================
   PRESTASI (timeline)
   ========================================================= */
.timeline {
  position: relative;
  padding-left: 30px;
  border-left: 2px solid var(--line-on-navy);
}
.timeline-item {
  position: relative;
  padding-bottom: 40px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -37px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--copper-light);
  border: 3px solid var(--navy-900);
  box-shadow: 0 0 0 2px var(--copper-light);
}
.timeline-year {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--copper-light);
  letter-spacing: 0.08em;
}
.timeline-item h3 {
  margin-top: 6px;
  font-size: 18px;
}
.timeline-item p {
  margin-top: 6px;
  font-size: 14.5px;
  color: rgba(246,244,236,0.7);
  max-width: 60ch;
}

/* =========================================================
   GALERI
   ========================================================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 160px;
  gap: 14px;
}
.gallery-grid > div:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.gallery-grid > div:nth-child(4) { grid-column: span 2; }

.gallery-item {
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 14px;
}
.gallery-item::before {
  content: "";
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line-on-navy) 1px, transparent 1px),
                     linear-gradient(90deg, var(--line-on-navy) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.6;
}
.gallery-item span {
  position: relative;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: rgba(246,244,236,0.8);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* =========================================================
   PENDAFTARAN (form)
   ========================================================= */
.register-wrap {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--line-on-paper);
  border-radius: 6px;
  overflow: hidden;
}

.register-info {
  background: var(--navy-900);
  color: var(--paper);
  padding: 48px 40px;
  background-image: linear-gradient(var(--line-on-navy) 1px, transparent 1px),
                     linear-gradient(90deg, var(--line-on-navy) 1px, transparent 1px);
  background-size: 36px 36px;
}
.register-info h3 { color: var(--paper); font-size: 24px; margin-top: 10px; }
.register-info p { color: rgba(246,244,236,0.72); margin-top: 14px; font-size: 14.5px; }

.req-list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: rgba(246,244,236,0.85);
}
.req-list li { display: flex; gap: 10px; align-items: flex-start; }
.req-list li::before { content: "▸"; color: var(--copper-light); }

.register-form { padding: 48px 44px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field { margin-bottom: 20px; }
.field.full { grid-column: 1 / -1; }

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.field .req { color: var(--copper); }

.field input,
.field select,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 12px 14px;
  border: 1px solid var(--line-on-paper);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--copper);
  background: var(--white);
  outline: none;
}
.field textarea { resize: vertical; min-height: 96px; }

.field-error {
  display: none;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--danger);
  font-family: var(--font-mono);
}
.field.invalid input,
.field.invalid select,
.field.invalid textarea { border-color: var(--danger); }
.field.invalid .field-error { display: block; }

.form-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

.submit-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.form-status {
  font-family: var(--font-mono);
  font-size: 13px;
}
.form-status.ok { color: var(--sage); }
.form-status.err { color: var(--danger); }

.success-panel {
  display: none;
  text-align: center;
  padding: 40px 20px;
}
.success-panel.show { display: block; }
.register-form.hide { display: none; }

.success-badge {
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--sage);
  display: flex;
  align-items: center;
  justify-content: center;
}
.success-badge svg { width: 30px; height: 30px; stroke: var(--white); }

.success-panel h3 { font-size: 21px; }
.success-panel p { margin-top: 10px; color: var(--ink-soft); font-size: 14.5px; }
.success-ticket {
  margin-top: 22px;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 18px;
  border: 1px dashed var(--line-on-paper);
  border-radius: var(--radius);
  color: var(--navy-900);
}

/* =========================================================
   FOOTER
   ========================================================= */
footer {
  background: var(--navy-900);
  color: rgba(246,244,236,0.65);
  padding: 56px 0 28px;
  border-top: 1px solid var(--line-on-navy);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-brand img { width: 38px; height: 38px; border-radius: 50%; }
.footer-brand strong { color: var(--paper); font-family: var(--font-display); font-size: 15px; }
.footer-col h4 {
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a, .footer-col span { font-size: 14px; }
.footer-col a:hover { color: var(--copper-light); }
.footer-bottom {
  border-top: 1px solid var(--line-on-navy);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-diagram { max-width: 340px; margin-top: 20px; }
  .about-grid { grid-template-columns: 1fr; }
  .program-grid { grid-template-columns: repeat(2, 1fr); }
  .register-wrap { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  :root { --nav-h: 64px; }
  .nav-links { position: fixed; top: var(--nav-h); left: 0; right: 0; background: var(--paper); flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 28px 18px; border-bottom: 1px solid var(--line-on-paper); transform: translateY(-140%); opacity: 0; pointer-events: none; transition: transform 0.25s ease, opacity 0.25s ease; }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 12px 0; width: 100%; border-bottom: 1px dashed var(--line-on-paper); }
  .nav-cta .btn-outline { display: none; }
  .menu-toggle { display: flex; }
  section { padding: 64px 0; }
  .program-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 140px; }
  .gallery-grid > div:nth-child(1) { grid-column: span 2; grid-row: span 1; }
  .gallery-grid > div:nth-child(4) { grid-column: span 1; }
  .form-row { grid-template-columns: 1fr; }
  .register-form, .register-info { padding: 32px 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-stats { gap: 24px; }
}
