/* ---------- Token ---------- */
:root {
  --paper: #f6f8df;
  --grid: #dde6b5;
  --ink: #12301c;
  --muted: #24432b;
  --green: #1b7d37;
  --marker: #ffd23f;
  --bg-top: #2f5d2a;     /* hijau SMAN 71 */
  --bg-bottom: #06130a;  /* makin gelap ke bawah */
  --on-bg: #f6f8df;      /* teks di atas background */
  --side: #bdbe8c;       /* sisi tebal kartu 3D */
  --gold-side: #a87000;  /* sisi tebal emas */
  --gloss: rgba(255, 255, 255, .7);
  --slab: 1px 1px 0 var(--side), 2px 2px 0 var(--side), 3px 3px 0 var(--side),
          4px 4px 0 var(--side), 5px 5px 0 var(--side), 6px 6px 0 var(--side),
          14px 22px 34px rgba(0, 0, 0, .45);
  --card: #fffff0;
  --line: #12301c;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;

  --max: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1f14;
    --grid: #1a3322;
    --ink: #f1f7d9;
    --muted: #c9d9b4;
    --green: #8fe08a;
    --marker: #e6c229;
    --side: #08150b;
    --gloss: rgba(255, 255, 255, .09);
    --bg-top: #2a5427;
    --bg-bottom: #040d06;
    --card: #16291c;
    --line: #f1f7d9;
  }
}

/* ---------- Dasar ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--on-bg);
  background-color: var(--bg-bottom);
  /* gradasi hijau SMAN 71 -> makin gelap */
  background-image: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-repeat: no-repeat;
  min-height: 100vh;
}


/* ---------- Warna membaur (blend) ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42vmax 42vmax at 85% 12%, rgba(255, 210, 63, .40), transparent 70%),
    radial-gradient(48vmax 48vmax at 8% 42%,  rgba(95, 207, 107, .34), transparent 70%),
    radial-gradient(42vmax 42vmax at 82% 82%, rgba(247, 181, 0, .28), transparent 70%),
    radial-gradient(38vmax 38vmax at 18% 100%, rgba(95, 207, 107, .30), transparent 70%);
  background-size: 140% 140%;
  animation: blend 16s ease-in-out infinite alternate;
}

@keyframes blend { to { background-position: 100% 100%; } }

h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.1;
  margin: 0;
}

p { margin: 0; }

a { color: var(--green); }

:focus-visible {
  outline: 3px solid var(--marker);
  outline-offset: 3px;
}

/* ---------- Header ---------- */
.top {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.top :focus-visible { outline-color: #12301c; }

/* shape rounded emas hanya membungkus teks */
.brand,
.top nav {
  background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 55%), #E5B80B;
  color: #12301c;
  border: 2px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 5px 0 #9c7b06, 0 12px 18px rgba(0, 0, 0, .4);
}

.brand {
  padding: .45rem 1.3rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
}

.top nav { display: flex; gap: .25rem; padding: .35rem .5rem; }

.top nav a {
  position: relative;
  overflow: hidden;
  padding: .4rem 1rem;
  color: #12301c;
  text-decoration: none;
  font-weight: 600;
  border-radius: 999px;
  transition: background .2s, color .2s, transform .12s;
}

.top nav a:hover { background: rgba(18, 48, 28, .14); }
.top nav a:active { transform: translateY(2px) scale(.93); }

/* menu yang sedang dibuka */
.top nav a.active { background: #12301c; color: #E5B80B; }

/* efek riak saat diklik */
.ripple {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .75);
  transform: scale(0);
  pointer-events: none;
  animation: ripple .6s ease-out forwards;
}

@keyframes ripple { to { transform: scale(16); opacity: 0; } }

/* judul section membal setelah menu diklik */
.section > h2.pop { animation: heading-pop .8s cubic-bezier(.2, 1.5, .4, 1); }

@keyframes heading-pop {
  40% { transform: rotate(-4deg) scale(1.18); }
}

/* ---------- Hero ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 3rem;
  align-items: center;
  padding: 4rem 0 5rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-size: .95rem;
  font-weight: 500;
  color: var(--on-bg);
  margin-bottom: 1.25rem;
}

.dot {
  width: .65rem;
  height: .65rem;
  border-radius: 50%;
  background: #1fb96b;
  box-shadow: 0 0 0 0 rgba(31, 185, 107, .6);
  animation: ping 2.2s ease-out infinite;
}

@keyframes ping {
  to { box-shadow: 0 0 0 .7rem rgba(31, 185, 107, 0); }
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -.03em;
  max-width: 14em;
  /* stabilo kuning di belakang teks */
  background-image: linear-gradient(var(--marker), var(--marker));
  background-repeat: no-repeat;
  background-size: 0% 38%;
  background-position: 0 90%;
  animation: stabilo .9s .3s ease-out forwards;
}

@keyframes stabilo { to { background-size: 100% 38%; } }

@media (prefers-color-scheme: dark) {
  .hero h1 { background-image: linear-gradient(#2e6a35, #2e6a35); }
}

.lead {
  margin-top: 1.5rem;
  max-width: 14em;
  color: var(--on-bg);
  font-family: "Londrina Solid", "Impact", "Arial Black", sans-serif;
  font-weight: 900;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  line-height: 1;
  letter-spacing: .01em;
}

.actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .8rem; }

.hero h1.hero-logo {
  background: none;
  animation: none;
  line-height: 0;
  max-width: 100%;
}

.hero-logo img {
  display: block;
  width: 100%;
  max-width: 14rem;
  height: auto;
}

/* ---------- Tombol ---------- */
.btn {
  display: inline-block;
  padding: .75rem 1.4rem;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0) 60%), var(--card);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 5px 0 var(--side), 0 12px 18px rgba(0, 0, 0, .35);
  transition: transform .12s, box-shadow .12s;
}

.btn:hover { transform: translateY(2px); box-shadow: 0 3px 0 var(--side), 0 8px 12px rgba(0, 0, 0, .35); }
.btn:active { transform: translateY(5px); box-shadow: 0 0 0 var(--side), 0 3px 6px rgba(0, 0, 0, .35); }

.btn.primary {
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0) 60%), var(--marker);
  color: #12301c;
  box-shadow: 0 5px 0 var(--gold-side), 0 12px 18px rgba(0, 0, 0, .35);
}
.btn.primary:hover { box-shadow: 0 3px 0 var(--gold-side), 0 8px 12px rgba(0, 0, 0, .35); }
.btn.primary:active { box-shadow: 0 0 0 var(--gold-side), 0 3px 6px rgba(0, 0, 0, .35); }

/* ---------- Kartu profil ---------- */
.card {
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem;
}

.card .logo {
  display: block;
  width: 100%;
  max-width: 11rem;
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto;
  object-fit: contain;
}

.card h2 {
  font-size: 1.15rem;
  padding-bottom: .8rem;
  margin-bottom: .4rem;
  border-bottom: 2px dashed var(--grid);
}

.card dl { margin: 0; }

.card dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--grid);
}

.card dl div:last-child { border-bottom: 0; }

.card dt { color: var(--muted); }
.card dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- Section ---------- */
.section { padding: 3rem 0; }

.section > h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -.02em;
  margin-bottom: 1.75rem;
  display: inline-block;
  padding: .3rem 2rem .4rem;
  background: var(--marker);
  color: #12301c;
  border: 2px solid var(--line);
  border-radius: 999px;
  border-radius: 999px;
  box-shadow: 0 5px 0 var(--gold-side), 0 10px 16px rgba(0, 0, 0, .35);
  transform: rotate(-1.2deg);
}

/* ---------- Proyek ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.project {
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.project h3 { font-size: 1.35rem; }
.project p { color: var(--muted); }
.project .tags { font-size: .9rem; color: var(--ink); font-weight: 500; }

.project a {
  margin-top: auto;
  font-weight: 600;
  text-underline-offset: 4px;
}

/* ---------- Skill ---------- */
.skills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

.skills li {
  padding: .45rem 1rem;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 999px;
  font-weight: 500;
}


/* ---------- Hiasan Beranda ---------- */
.project { position: relative; }

.ico {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  background: var(--marker);
  border: 2px solid var(--line);
  border-radius: 50%;
}

/* ---------- Hiasan Produk ---------- */
.skills li { box-shadow: 3px 3px 0 var(--line); transition: transform .12s; }
.skills li:hover { transform: translateY(-3px) rotate(-2deg); }
.skills li span { margin-right: .35rem; }

/* ---------- Desain ---------- */
.designs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.design {
  margin: 0;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.design .art {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  font-size: 4.5rem;
  border-bottom: 2px solid var(--line);
}

.design figcaption { display: flex; flex-direction: column; padding: 1rem 1.25rem; }
.design figcaption strong { font-family: var(--display); font-size: 1.2rem; }
.design figcaption span { color: var(--muted); font-size: .95rem; }

.d1 .art { background: radial-gradient(circle at 25% 30%, #fff 0 8%, transparent 9%), linear-gradient(135deg, #ffe94a, #ff9f43); }
.d2 .art { background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.7) 0 10%, transparent 11%), linear-gradient(135deg, #8fe08a, #1b7d37); }
.d3 .art { background: radial-gradient(circle at 50% 40%, #3b7a57 0, #12301c 70%); }

@media (prefers-reduced-motion: reduce) {
  .project, .design, .skills li { transition: none; }
}

/* ---------- Kontak ---------- */
.contact {
  margin: 2rem 0 4rem;
  padding: 3rem 2rem;
  text-align: center;
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 8px;
}

.contact h2 { margin-bottom: 1rem; }

.contact p {
  max-width: 30em;
  margin: 0 auto 1.75rem;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.foot {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  color: var(--on-bg);
  font-size: .95rem;
}

/* ---------- Responsif ---------- */
@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-top: 2rem;
  }

  .card { --rot: 0deg; max-width: 420px; }
}

@media (max-width: 480px) {
  .top { flex-direction: column; align-items: flex-start; }
  .top nav { gap: 1.1rem; }
  .contact { padding: 2rem 1.25rem; }
}


/* ---------- Transisi pembuka ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  animation: intro-hide 0s 2.9s forwards;
}

.intro-panel {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  background: #173d1c;
}

.intro-panel.p-up {
  top: 0;
  border-bottom: 3px solid var(--marker);
  animation: panel-up .8s cubic-bezier(.77, 0, .18, 1) 2.1s forwards;
}

.intro-panel.p-down {
  bottom: 0;
  border-top: 3px solid var(--marker);
  animation: panel-down .8s cubic-bezier(.77, 0, .18, 1) 2.1s forwards;
}

.intro-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  animation: intro-out .35s ease-in 1.95s forwards;
}

/* logo SMA 71 terbelah, lalu menyatu */
.logo-split {
  position: relative;
  isolation: isolate;
  width: min(78vw, 62vh, 34rem);
  aspect-ratio: 1;
  animation: merge-pop .45s ease-out 1.15s;
}

.logo-split::before {
  content: "";
  position: absolute;
  inset: -35%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 122, .85), transparent 65%);
  opacity: 0;
  animation: burst .7s ease-out 1.15s;
}

.logo-split .half {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.logo-split .l {
  clip-path: inset(0 49.5% 0 0);
  animation: join-l 1s cubic-bezier(.7, 0, .2, 1) .2s both;
}

.logo-split .r {
  clip-path: inset(0 0 0 49.5%);
  animation: join-r 1s cubic-bezier(.7, 0, .2, 1) .2s both;
}

@keyframes join-l {
  from { opacity: 0; transform: translateX(-70%) rotate(-14deg); }
  25%  { opacity: 1; }
  to   { opacity: 1; transform: none; }
}

@keyframes join-r {
  from { opacity: 0; transform: translateX(70%) rotate(14deg); }
  25%  { opacity: 1; }
  to   { opacity: 1; transform: none; }
}

@keyframes merge-pop { 50% { transform: scale(1.14); } }
@keyframes burst { 30% { opacity: 1; } to { opacity: 0; transform: scale(1.5); } }

.intro-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.2rem, 7vmin, 3.2rem);
  letter-spacing: .06em;
  color: #f6f8df;
  animation: rise .6s ease-out 1.15s both;
}

.intro-bar {
  width: clamp(12rem, 36vmin, 18rem);
  height: .7rem;
  border: 2px solid #f6f8df;
  border-radius: 999px;
  overflow: hidden;
}

.intro-bar span {
  display: block;
  height: 100%;
  background: var(--marker);
  animation: bar 1.4s ease-in-out .4s both;
}

@keyframes panel-up   { to { transform: translateY(-101%); } }
@keyframes panel-down { to { transform: translateY(101%); } }
@keyframes intro-out  { to { opacity: 0; transform: scale(.9); } }
@keyframes intro-hide { to { visibility: hidden; } }
@keyframes logo-in    { from { opacity: 0; transform: scale(.5) rotate(-8deg); } }
@keyframes rise       { from { opacity: 0; transform: translateY(14px); } }
@keyframes bar        { from { width: 0; } to { width: 100%; } }

/* isi halaman muncul setelah tirai terbuka */
.hero-text, .hero > .card {
  animation: page-in .8s ease-out 2.35s both;
}

@keyframes page-in { from { opacity: 0; translate: 0 28px; } }


/* ---------- Tampilan 3D (seperti hasil render) ---------- */
.card, .project, .design, .contact {
  background-image: linear-gradient(150deg, var(--gloss), transparent 45%);
  box-shadow: var(--slab);
}

.card, .project, .design {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg))
             rotate(var(--rot, 0deg)) translateY(var(--lift, 0px));
  transition: transform .15s ease-out;
  will-change: transform;
}

.card { --rot: 1.5deg; }
.project:nth-child(odd) { --rot: -.6deg; }
.project:nth-child(even) { --rot: .6deg; }
.project:hover, .design:hover { --lift: -5px; }

.skills li { box-shadow: 0 4px 0 var(--side), 0 8px 12px rgba(0, 0, 0, .3); }

.hero-logo img {
  transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .2s ease-out;
  filter: drop-shadow(0 22px 18px rgba(0, 0, 0, .45));
  animation: logo-float 4s ease-in-out infinite;
}

@keyframes logo-float { 50% { translate: 0 -10px; } }

/* tanduk logo SMAN 71 mengambang di latar */
.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.horn {
  position: absolute;
  height: auto;
  color: #eef0e6;
  overflow: visible;
  filter: drop-shadow(0 20px 14px rgba(0, 0, 0, .45));
  animation: bob 7s ease-in-out infinite;
}

.h1 { width: 100px; top: 13%; right: 4%; transform: rotate(14deg); }
.h2 { width: 64px; top: 50%; left: 2%; transform: scaleX(-1) rotate(10deg); animation-delay: -2s; }
.h3 { width: 78px; bottom: 9%; right: 5%; color: #E5B80B; transform: rotate(-12deg); animation-delay: -4s; }
.h4 { width: 90px; bottom: -40px; left: -1%; transform: scaleX(-1) rotate(-6deg); animation-delay: -1s; }

@keyframes bob { 50% { translate: 0 -22px; } }

/* komet jatuh */
.comet {
  position: absolute;
  width: 190px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #fff, rgba(255, 226, 122, .75) 22%, rgba(255, 226, 122, 0));
  transform: rotate(-35deg);
  opacity: 0;
  animation: comet 9s linear infinite;
}

.comet::before {
  content: "";
  position: absolute;
  left: -3px;
  top: 50%;
  width: 11px;
  height: 11px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 4px rgba(255, 226, 122, .85), 0 0 26px 10px rgba(229, 184, 11, .4);
}

.c1 { top: -2%;  right: 8%;  animation-duration: 9s;  animation-delay: 3s; }
.c2 { top: 8%;   right: 42%; animation-duration: 13s; animation-delay: 6s; }
.c3 { top: -4%;  right: 68%; animation-duration: 11s; animation-delay: 9s; }
.c4 { top: 24%;  right: -4%; animation-duration: 15s; animation-delay: 12s; }

@keyframes comet {
  0%   { opacity: 0; translate: 0 0; }
  2%   { opacity: 1; }
  15%  { opacity: 1; }
  18%  { opacity: 0; translate: -62vmax 43vmax; }
  100% { opacity: 0; translate: -62vmax 43vmax; }
}

@media (max-width: 800px) { .horn { display: none; } }

/* ---------- Pindah halaman ---------- */
.no-intro .intro { display: none; }
.no-intro .hero-text, .no-intro .hero > .card { animation-duration: .5s; animation-delay: 0s; }

body.leaving main, body.leaving .top { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; }

/* ---------- Kurangi gerakan ---------- */
@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
  .horn, .hero-logo img { animation: none; }
  .comet { display: none; }
  body::before { animation: none; }
  .hero-text, .hero > .card { animation: none; }
  html { scroll-behavior: auto; }
  .dot { animation: none; }
  .hero h1 { animation: none; background-size: 100% 38%; }
  .btn, .card, .project, .design { transition: none; }
  .section > h2.pop, .ripple { animation: none; }
}
