/* Gaya OXI "Apex Maxi Touring": hitam kokpit, merah racing, aksen silver. */
:root {
  --bg: #0c0d0f;
  --surface: #16181d;
  --surface-2: #21242d;
  --input: #0f1013;
  --border: rgba(226, 232, 240, .1);
  --border-strong: #2a2d35;
  --text: #ffffff;
  --muted: #94a3b8;
  --silver: #e2e8f0;
  --red: #e5252a;
  --red-deep: #b91c1c;
  --amber: #ffaa00;
  --glow: 0 8px 24px -4px rgba(229, 37, 42, .45);
  --r: 4px;
  --r-card: 8px;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(229, 37, 42, .16), transparent 60%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 22px),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button, input, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Navigasi ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 32px;
  background: rgba(12, 13, 15, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav::after {
  content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: 180px;
  background: linear-gradient(90deg, var(--red), transparent);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 44px; height: 44px; object-fit: contain; }
.brand strong { display: block; font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: .04em; line-height: 1.1; }
.brand small { display: block; font-family: var(--font-display); font-weight: 700; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  padding: 10px 14px; border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); border-bottom-color: var(--red); }

/* ---------- Hero ---------- */
.hero {
  max-width: 1200px; width: 100%; margin: 0 auto;
  padding: 40px 32px 8px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.hero-text { max-width: 720px; display: grid; gap: 12px; }
.chip {
  justify-self: start;
  font-family: var(--font-display); font-weight: 800; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text);
  background: rgba(229, 37, 42, .14);
  border: 1px solid rgba(229, 37, 42, .6);
  padding: 6px 12px 6px 14px;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}
.hero h1 {
  margin: 0;
  font-family: var(--font-display); font-weight: 800;
  font-size: 52px; line-height: 1.08; letter-spacing: -.02em;
  text-transform: uppercase;
}
.hero h1 em { font-style: normal; color: var(--red); }
.hero p { margin: 0; color: var(--muted); font-size: 16px; max-width: 560px; }

.stats { display: grid; grid-template-columns: repeat(3, auto); gap: 0; margin: 0; }
.stats div { padding: 4px 22px; border-left: 1px solid var(--border-strong); }
.stats div:first-child { border-left: 3px solid var(--red); }
.stats dt { font-family: var(--font-display); font-weight: 700; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 28px; font-variant-numeric: tabular-nums; }

.hero-sm { padding-bottom: 0; }
.hero-sm h1 { font-size: 44px; }

/* ---------- Tata letak editor ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 24px;
  max-width: 1200px; width: 100%;
  margin: 0 auto;
  padding: 28px 32px 48px;
}

.stage-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }

.stage {
  position: relative;
  width: 100%; max-width: 600px;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px -20px rgba(229, 37, 42, .35), 0 0 0 1px rgba(0, 0, 0, .6);
}

canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; }
canvas.dragging { cursor: grabbing; }

.dropzone {
  position: absolute; left: 50%; top: 46.6%;
  width: 84%; height: 53%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 2px dashed rgba(226, 232, 240, .35);
  border-radius: 6%;
  background: rgba(12, 13, 15, .55);
  cursor: pointer; text-align: center; padding: 16px;
  transition: background .2s, border-color .2s;
}
.dropzone:hover, .dropzone.over { background: rgba(229, 37, 42, .14); border-color: var(--red); }
.dropzone[hidden] { display: none; }
.dz-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--red); color: #fff;
  font-size: 30px; font-weight: 700;
  box-shadow: var(--glow);
}
.dz-title { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: .04em; text-transform: uppercase; }
.dz-sub { color: var(--muted); font-size: 13px; }

.hint { color: var(--muted); font-size: 13px; margin: 0; text-align: center; max-width: 600px; }
.hint[hidden] { display: none; }

.adjust {
  width: 100%; max-width: 600px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 16px;
  display: grid; gap: 12px;
}
.adjust[hidden] { display: none; }

.slider {
  display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: 12px;
  font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
input[type="range"] { width: 100%; accent-color: var(--red); }

.row { display: flex; flex-wrap: wrap; gap: 8px; }
.row .btn { flex: 1; }

/* ---------- Kartu panel ---------- */
.panel { display: flex; flex-direction: column; gap: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 18px 20px 20px;
  display: grid; gap: 14px;
}
.card h2 {
  margin: 0;
  font-family: var(--font-display); font-weight: 800; font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  border-left: 3px solid var(--red);
  padding-left: 10px;
  line-height: 1.2;
}

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
.steps li { display: flex; gap: 12px; align-items: baseline; }
.steps b { font-family: var(--font-display); font-weight: 800; color: var(--red); font-size: 13px; letter-spacing: .06em; }

.note { margin: 0; font-size: 13px; color: var(--muted); }
.note:empty, .note[hidden] { display: none; }
.link { background: none; border: 0; color: var(--red); cursor: pointer; padding: 0; font-weight: 600; }

.field { display: grid; gap: 6px; }
.field > span {
  font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.field input, .field textarea {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  padding: 11px 12px;
  resize: vertical;
}
.field input::placeholder { color: #5b6476; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(229, 37, 42, .25); }

.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--red); border-radius: 2px; }

/* ---------- Tombol ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px;
  border-radius: var(--r);
  border: 1.5px solid var(--muted);
  background: rgba(148, 163, 184, .05);
  font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text);
  cursor: pointer; text-align: center; text-decoration: none;
  transition: filter .15s, box-shadow .15s, border-color .15s, background .15s;
}
.btn.secondary:hover { border-color: var(--silver); background: rgba(148, 163, 184, .12); }
.btn.primary {
  background: var(--red); border-color: var(--red);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.btn.primary:hover { filter: brightness(1.12); box-shadow: var(--glow); }
.btn.primary:active { background: var(--red-deep); }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: none; box-shadow: none; }
.btn[hidden] { display: none; }
.btn.danger { border-color: rgba(248, 113, 113, .6); color: #fca5a5; }
.btn.danger:hover { border-color: #f87171; background: rgba(248, 113, 113, .1); }
.btn:focus-visible, .share-btn:focus-visible, .tabs button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ---------- Tombol bagikan ---------- */
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.share-btn {
  display: grid; justify-items: center; gap: 6px;
  padding: 12px 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface-2);
  cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: .04em;
  transition: border-color .15s, transform .15s;
}
.share-btn:hover:not(:disabled) { border-color: var(--tint); transform: translateY(-1px); }
.share-btn:disabled { opacity: .4; cursor: not-allowed; }
.share-ic {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--tint);
  color: #ffffff; font-size: 14px; font-weight: 800; letter-spacing: 0;
}
.share-btn[data-target="more"] .share-ic, .share-btn[data-target="copy"] .share-ic { color: #0c0d0f; }
.share-btn[data-target="story"] .share-ic { background: radial-gradient(circle at 30% 110%, #ffdc80, #f77737 25%, #e1306c 55%, #833ab4 85%); }
.share-btn[data-target="x"] .share-ic { color: #0c0d0f; }

/* ---------- Galeri ---------- */
.gallery-page { max-width: 1200px; width: 100%; margin: 0 auto; padding: 24px 32px 48px; display: grid; gap: 18px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-strong); }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 16px; margin-bottom: -1px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); cursor: pointer;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--red); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.g-card {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface);
  overflow: hidden; cursor: pointer; text-align: left;
  display: grid;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.g-card:hover { transform: translateY(-2px); border-color: rgba(229, 37, 42, .6); box-shadow: var(--glow); }
.g-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--surface-2); }
.g-meta { display: grid; padding: 10px 12px 12px; border-top: 2px solid var(--red); }
.g-meta strong { font-family: var(--font-display); font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-meta small { color: var(--muted); font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 60px 16px; border: 1px dashed var(--border-strong); border-radius: var(--r-card); }
.empty a { color: var(--red); font-weight: 600; }
.empty[hidden], .more[hidden] { display: none; }
.more { justify-self: center; min-width: 220px; }

.lightbox {
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--text);
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
}
.lightbox::backdrop { background: rgba(0, 0, 0, .8); backdrop-filter: blur(4px); }
.lightbox img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #000; }
.lb-body { display: grid; gap: 14px; padding: 16px; }
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lb-head strong { display: block; font-family: var(--font-display); font-size: 18px; }
.lb-head small { color: var(--muted); }
.lb-head .btn { padding: 8px 12px; }

/* ---------- Footer & toast ---------- */
.foot {
  margin-top: auto;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 20px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
}
.foot img { width: 28px; height: 28px; object-fit: contain; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  transform: translate(-50%, 20px);
  background: var(--surface-2); color: var(--text);
  border: 1px solid rgba(229, 37, 42, .6);
  border-left: 3px solid var(--red);
  padding: 11px 18px; border-radius: var(--r);
  font-weight: 600; font-size: 14px;
  max-width: calc(100vw - 32px);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsif ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; padding: 20px 16px 40px; gap: 16px; }
  .hero { padding: 28px 16px 0; gap: 20px; }
  .hero h1 { font-size: 36px; }
  .hero-sm h1 { font-size: 32px; }
  .stats { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .stats div { padding: 4px 12px; }
  .stats dd { font-size: 20px; }
  .nav { padding: 8px 16px; }
  .gallery-page { padding: 20px 16px 40px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 420px) {
  .brand small { display: none; }
  .nav-links a { padding: 10px 10px; }
  .hero h1 { font-size: 30px; }
  .share-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .share-btn { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
