/* =========================================================================
   Design system — Midnight / Ember
   Palet: hitam pekat, oranye menyala, kuning emas.
   ========================================================================= */

:root {
  --ink-950: #050505;
  --ink-900: #0a0a0a;
  --ink-850: #0f0f10;
  --ink-800: #151517;
  --ink-700: #1d1d20;
  --line: rgba(255, 255, 255, 0.08);

  --brand-400: #fb923c;
  --brand-500: #f97316;
  --brand-600: #ea580c;
  --accent-300: #fde047;
  --accent-400: #facc15;

  --ember: linear-gradient(135deg, #facc15 0%, #f97316 45%, #ea580c 100%);
  --ember-soft: linear-gradient(135deg, rgba(250, 204, 21, 0.18), rgba(249, 115, 22, 0.12));

  --shadow-glow: 0 18px 60px -18px rgba(249, 115, 22, 0.55);
  --nav-h: 4.5rem;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  background-color: var(--ink-950);
  color: #e7e5e4;
  font-family: "Plus Jakarta Sans", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
  font-family: "Sora", "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.02em;
}

/* ------------------------------------------------------------------ layers */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

.bg-noise::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(90px);
  pointer-events: none;
  will-change: transform;
}

.orb-a { background: rgba(249, 115, 22, 0.28); animation: drift-a 18s ease-in-out infinite; }
.orb-b { background: rgba(250, 204, 21, 0.18); animation: drift-b 22s ease-in-out infinite; }
.orb-c { background: rgba(234, 88, 12, 0.16); animation: drift-a 26s ease-in-out infinite reverse; }

@keyframes drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(40px, -30px, 0) scale(1.12); }
}
@keyframes drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.05); }
  50%      { transform: translate3d(-45px, 35px, 0) scale(0.92); }
}

/* ------------------------------------------------------------------ text */
.text-ember {
  background: var(--ember);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-ember-anim {
  background: linear-gradient(100deg, #facc15, #f97316, #fde047, #ea580c, #facc15);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shift 7s ease infinite;
}

@keyframes shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.typed-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -0.12em;
  background: var(--brand-500);
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ------------------------------------------------------------------ surfaces */
.card {
  position: relative;
  border-radius: 1.25rem;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  backdrop-filter: blur(10px);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.35s ease, box-shadow 0.45s ease;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(249, 115, 22, 0.45);
  box-shadow: var(--shadow-glow);
}

/* Border gradasi yang menyala saat hover */
.card-glow::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--ember);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.card-glow:hover::before { opacity: 1; }

/* Sorotan mengikuti kursor (di-set lewat JS: --mx / --my) */
.spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%),
              rgba(249, 115, 22, 0.16), transparent 62%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.spotlight:hover::after { opacity: 1; }

.glass {
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease,
              background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--ember);
  color: #1a0b00;
  box-shadow: 0 10px 30px -10px rgba(249, 115, 22, 0.7);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -12px rgba(250, 204, 21, 0.75);
}

.btn-ghost {
  border: 1px solid var(--line);
  color: #e7e5e4;
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
  border-color: rgba(249, 115, 22, 0.6);
  color: var(--accent-300);
  transform: translateY(-2px);
}

/* Kilau yang menyapu tombol */
.btn-shine { position: relative; overflow: hidden; }
.btn-shine::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
}
.btn-shine:hover::after { animation: shine 0.9s ease; }

@keyframes shine { to { left: 140%; } }

/* ------------------------------------------------------------------ chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #d6d3d1;
  transition: all 0.25s ease;
}

.chip:hover {
  border-color: rgba(249, 115, 22, 0.55);
  color: var(--accent-300);
  background: rgba(249, 115, 22, 0.1);
}

.chip-active {
  border-color: transparent;
  background: var(--ember);
  color: #1a0b00;
}

/* ------------------------------------------------------------------ reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-left  { transform: translateX(-36px); }
.reveal-right { transform: translateX(36px); }
.reveal-zoom  { transform: scale(0.92); }

.reveal.is-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* ------------------------------------------------------------------ timeline */
.timeline {
  position: relative;
  padding-left: 2.25rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.6rem;
  top: 0.25rem;
  bottom: 0.25rem;
  width: 2px;
  background: linear-gradient(180deg, var(--brand-500), rgba(250, 204, 21, 0.5), transparent);
}

.timeline-dot {
  position: absolute;
  left: -1.85rem;
  top: 1.6rem;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 9999px;
  background: var(--ember);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.16);
}

.timeline-dot-live::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: var(--brand-500);
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%, 100% { transform: scale(2.4); opacity: 0; }
}

@media (min-width: 768px) {
  .timeline { padding-left: 3rem; }
  .timeline::before { left: 1rem; }
  .timeline-dot { left: -2.15rem; }
}

/* ------------------------------------------------------------------ marquee */
.marquee {
  display: flex;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee__track {
  display: flex;
  flex-shrink: 0;
  gap: 1rem;
  padding-right: 1rem;
  animation: marquee 32s linear infinite;
}

.marquee:hover .marquee__track { animation-play-state: paused; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ------------------------------------------------------------------ misc fx */
.float { animation: float 6s ease-in-out infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--ember);
  z-index: 60;
  transition: width 0.1s linear;
}

.skill-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 9999px;
  background: var(--ember);
  transition: width 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.link-underline {
  position: relative;
}

.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 2px;
  width: 0;
  background: var(--ember);
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.link-underline:hover::after,
.link-underline.is-active::after { width: 100%; }

.img-zoom { overflow: hidden; }
.img-zoom img {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.img-zoom:hover img { transform: scale(1.07); }

/* ------------------------------------------------------------------ prose */
.prose-ember {
  color: #d6d3d1;
  line-height: 1.85;
  font-size: 1.02rem;
}
.prose-ember h2,
.prose-ember h3 {
  color: #fafaf9;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}
.prose-ember h2 { font-size: 1.5rem; }
.prose-ember h3 { font-size: 1.22rem; }
.prose-ember p { margin-bottom: 1.15rem; }
.prose-ember a { color: var(--accent-400); text-decoration: underline; text-underline-offset: 3px; }
.prose-ember a:hover { color: var(--brand-400); }
.prose-ember ul, .prose-ember ol { margin: 0 0 1.15rem 1.35rem; }
.prose-ember ul { list-style: disc; }
.prose-ember ol { list-style: decimal; }
.prose-ember li { margin-bottom: 0.4rem; }
.prose-ember img { border-radius: 1rem; margin: 1.5rem 0; max-width: 100%; height: auto; }
.prose-ember blockquote {
  border-left: 3px solid var(--brand-500);
  padding: 0.25rem 0 0.25rem 1.15rem;
  margin: 1.5rem 0;
  color: #a8a29e;
  font-style: italic;
}
.prose-ember pre {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1.15rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}
.prose-ember code {
  background: rgba(249, 115, 22, 0.12);
  color: var(--accent-300);
  padding: 0.12rem 0.4rem;
  border-radius: 0.35rem;
  font-size: 0.875em;
}
.prose-ember pre code { background: none; color: inherit; padding: 0; }
.prose-ember table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; }
.prose-ember th, .prose-ember td { border: 1px solid var(--line); padding: 0.6rem 0.8rem; text-align: left; }

/* ------------------------------------------------------------------ forms */
select option {
  background: var(--ink-800);
  color: #e7e5e4;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.75) sepia(1) saturate(6) hue-rotate(-15deg);
  cursor: pointer;
}

.errorlist {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  font-size: 0.78rem;
  color: #fca5a5;
}

/* Django merender field berkas sebagai teks lepas ("Saat ini / Hapus / Ubah").
   Blok di bawah merapikannya jadi satu kartu yang tidak menabrak kolom lain. */
.file-field {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #a3a3a3;
  overflow-wrap: anywhere;
}

.file-field a {
  color: var(--accent-400);
  overflow-wrap: anywhere;
}

.file-field a:hover {
  color: var(--brand-400);
}

.file-field__thumb {
  width: 5rem;
  height: 5rem;
  border-radius: 0.7rem;
  border: 1px solid var(--line);
  object-fit: cover;
  background: var(--ink-800);
}

.file-field input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin-right: 0.3rem;
  vertical-align: -0.15rem;
  accent-color: var(--brand-500);
}

.file-field input[type="file"] {
  display: block;
  margin-top: 0.15rem;
  max-width: 100%;
}

/* ------------------------------------------------------------------ nav */
.nav-shrink {
  box-shadow: 0 10px 34px -18px rgba(0, 0, 0, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.mobile-panel {
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-panel.is-open { transform: translateX(0); }

.mobile-panel a {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.mobile-panel.is-open a {
  opacity: 1;
  transform: translateX(0);
}

.burger span {
  display: block;
  height: 2px;
  width: 22px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.35s ease, opacity 0.25s ease;
}

.burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ------------------------------------------------------------------ toast */
.toast {
  animation: toast-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(-14px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

/* ------------------------------------------------------------------ scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-900); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand-600), var(--brand-500));
  border-radius: 9999px;
  border: 2px solid var(--ink-900);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-400); }

::selection { background: rgba(249, 115, 22, 0.35); color: #fff7ed; }

/* ------------------------------------------------------------------ a11y */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 3px;
  border-radius: 0.35rem;
}
