/* =========================================================
   Design tokens
   ========================================================= */
:root {
  --ink: #12141A;
  --ink-soft: #565D6B;
  --paper: #F5F6F8;
  --surface: #FFFFFF;
  --surface-alt: #F1F2F5;
  --surface-shot: #E9EAEE;
  --line: #E3E6EC;
  --dot: #D5D8DF;
  --accent: #3452FF;
  --accent-ink: #FFFFFF;
  --lime: #C6FF3D;
  --danger: #E5484D;
  --danger-bg: #FDECEE;
  --success: #1A8A5F;
  --success-bg: #E9F8F1;
  --warn-bg: #FFF4DE;
  --warn-text: #A15C00;
  --info-bg: #EAF0FF;
  --btn-primary-bg: #12141A;
  --btn-primary-text: #FFFFFF;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 14px;
  --radius-sm: 8px;
}

html[data-mode="dark"] {
  --ink: #F1F2F5;
  --ink-soft: #9AA1AD;
  --paper: #0B0C10;
  --surface: #15171D;
  --surface-alt: #1B1E25;
  --surface-shot: #1F222B;
  --line: #272A33;
  --dot: #3A3E48;
  --accent: #7086FF;
  --accent-ink: #0B0C10;
  --lime: #C6FF3D;
  --danger: #FF7A7D;
  --danger-bg: #3A1418;
  --success: #3FCB92;
  --success-bg: #103023;
  --warn-bg: #3A2E10;
  --warn-text: #F3B94D;
  --info-bg: #182444;
  --btn-primary-bg: #F1F2F5;
  --btn-primary-text: #12141A;
}

html { transition: background-color .15s ease; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 .5em;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.brand__mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--btn-primary-bg); color: var(--btn-primary-text);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
}
.brand__accent { color: var(--accent); }
.nav { display: flex; align-items: center; gap: 22px; font-weight: 500; font-size: .95rem; }
.nav a:not(.btn):hover { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; border-radius: 999px; font-weight: 600; font-size: .9rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); }
.btn--primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { border-color: var(--line); color: var(--ink); }
.btn--lime { background: var(--lime); color: var(--ink); }
.btn--block { width: 100%; }
.btn--danger { background: var(--danger-bg); color: var(--danger); }
.btn--icon { padding: 9px 11px; }
.btn--icon .icon-mode { display: flex; }

/* =========================================================
   Flash messages
   ========================================================= */
.flash { margin-top: 18px; padding: 12px 16px; border-radius: var(--radius-sm); font-size: .92rem; font-weight: 500; }
.flash--success { background: var(--success-bg); color: var(--success); }
.flash--error { background: var(--danger-bg); color: var(--danger); }
.flash--info { background: var(--info-bg); color: var(--accent); }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  padding: 64px 0 40px;
}
.hero__eyebrow {
  font-family: var(--font-mono); font-size: .8rem; color: var(--accent);
  letter-spacing: .04em; margin-bottom: 14px; display: block;
}
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); max-width: 14ch; }
.hero p { color: var(--ink-soft); max-width: 46ch; font-size: 1.05rem; }
.hero__stats { display: flex; gap: 32px; margin-top: 28px; }
.hero__stat b { font-family: var(--font-display); font-size: 1.6rem; display: block; }
.hero__stat span { color: var(--ink-soft); font-size: .85rem; }

/* =========================================================
   Browser-chrome card — signature element
   ========================================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
  padding: 8px 0 60px;
}
.browser-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.browser-card:hover { box-shadow: 0 12px 28px rgba(18,20,26,.09); transform: translateY(-3px); }
.browser-card__bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--surface-alt); border-bottom: 1px solid var(--line);
}
.browser-card__dots { display: flex; gap: 5px; flex-shrink: 0; }
.browser-card__dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.browser-card__url {
  font-family: var(--font-mono); font-size: .74rem; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 10px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.browser-card__shot { aspect-ratio: 16/10; overflow: hidden; background: var(--surface-shot); position: relative; }
.browser-card__shot img { width: 100%; height: 100%; object-fit: cover; }
.browser-card__play {
  position: absolute; top: 10px; right: 10px;
  background: var(--lime); color: var(--ink); font-family: var(--font-mono);
  font-size: .7rem; font-weight: 500; padding: 4px 10px; border-radius: 999px;
}
.browser-card__body { padding: 16px 16px 18px; }
.browser-card__title { font-size: 1.05rem; margin-bottom: 4px; }
.browser-card__desc { color: var(--ink-soft); font-size: .88rem; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.browser-card__author { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--ink-soft); }
.browser-card__author img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: var(--line); }

.empty-state {
  text-align: center; padding: 80px 20px; color: var(--ink-soft);
}
.empty-state h3 { color: var(--ink); }

/* =========================================================
   Tema: Majalah / Editorial
   ========================================================= */
.tema-majalah { max-width: 780px; margin: 0 auto; padding: 8px 0 60px; }
.majalah-row {
  display: flex; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--line);
  align-items: center;
}
.majalah-row:first-child { padding-top: 0; }
.majalah-row__thumb { flex-shrink: 0; width: 200px; aspect-ratio: 16/10; border-radius: 10px; overflow: hidden; background: var(--line); }
.majalah-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.majalah-row__kicker { font-family: var(--font-mono); font-size: .72rem; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.majalah-row__title { font-size: 1.4rem; margin: 4px 0 8px; }
.majalah-row__desc { color: var(--ink-soft); font-size: .92rem; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.majalah-row__meta { display: flex; align-items: center; justify-content: space-between; font-size: .85rem; color: var(--ink-soft); }
.majalah-row__meta img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; margin-right: 7px; vertical-align: -6px; background: var(--line); }
.majalah-row__cta { font-weight: 600; color: var(--accent); }
@media (max-width: 640px) {
  .majalah-row { flex-direction: column; align-items: stretch; }
  .majalah-row__thumb { width: 100%; }
}

/* =========================================================
   Tema: Bento Box
   ========================================================= */
.tema-bento {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 160px;
  gap: 14px; padding: 8px 0 60px;
}
.bento-card {
  position: relative; grid-column: span 2; grid-row: span 1;
  border-radius: var(--radius); overflow: hidden; background: var(--line);
}
.bento-card--besar { grid-column: span 2; grid-row: span 2; }
.bento-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.bento-card:hover img { transform: scale(1.05); }
.bento-card__overlay {
  position: absolute; inset: auto 0 0 0; padding: 30px 16px 14px;
  background: linear-gradient(to top, rgba(10,11,14,.85), transparent);
  color: #fff;
}
.bento-card__overlay h3 { color: #fff; font-size: 1rem; margin: 0 0 2px; }
.bento-card__overlay span { font-size: .78rem; color: rgba(255,255,255,.75); }
@media (max-width: 720px) {
  .tema-bento { grid-template-columns: repeat(2, 1fr); }
  .bento-card, .bento-card--besar { grid-column: span 1; grid-row: span 1; }
}

/* =========================================================
   Tema: Direktori / Katalog
   ========================================================= */
.tema-direktori { display: grid; grid-template-columns: 220px 1fr; gap: 28px; padding: 8px 0 60px; align-items: start; }
.direktori-sidebar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 84px; }
.direktori-sidebar h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin-bottom: 10px; }
.direktori-sidebar p { font-size: .88rem; margin: 0 0 14px; }
.direktori-sidebar__list { list-style: none; margin: 0; padding: 0; font-size: .84rem; }
.direktori-sidebar__list li { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); }
.direktori-sidebar__count { font-family: var(--font-mono); color: var(--ink-soft); }
.direktori-list { display: flex; flex-direction: column; gap: 2px; }
.direktori-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  border: 1px solid transparent; border-radius: 10px;
}
.direktori-row:hover { background: var(--surface); border-color: var(--line); }
.direktori-row__thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--line); flex-shrink: 0; }
.direktori-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.direktori-row__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.direktori-row__info strong { font-size: .95rem; }
.direktori-row__slug { font-family: var(--font-mono); font-size: .74rem; color: var(--ink-soft); }
.direktori-row__author { font-size: .82rem; color: var(--ink-soft); flex-shrink: 0; }
@media (max-width: 720px) {
  .tema-direktori { grid-template-columns: 1fr; }
  .direktori-sidebar { position: static; }
}

/* =========================================================
   Forms
   ========================================================= */
.form-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px; max-width: 460px; margin: 40px auto;
}
.form-card--wide { max-width: 640px; }
.form-card h2 { margin-bottom: 6px; }
.form-card .sub { color: var(--ink-soft); font-size: .9rem; margin-bottom: 26px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.field .hint { color: var(--ink-soft); font-size: .78rem; margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=file], textarea, select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .95rem; background: var(--surface); color: var(--ink);
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 110px; }
.form-foot { margin-top: 22px; font-size: .88rem; color: var(--ink-soft); text-align: center; }
.form-foot a { color: var(--accent); font-weight: 600; }

/* =========================================================
   Dashboard
   ========================================================= */
.page-head { padding: 40px 0 20px; display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px; }
.page-head p { color: var(--ink-soft); margin: 4px 0 0; }

.table-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 60px; }
.table-list table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table-list th, .table-list td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); }
.table-list th { font-family: var(--font-mono); font-weight: 500; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); background: var(--surface-alt); }
.table-list tr:last-child td { border-bottom: none; }

.badge { display: inline-flex; padding: 4px 11px; border-radius: 999px; font-size: .76rem; font-weight: 600; font-family: var(--font-mono); }
.badge--pending { background: var(--warn-bg); color: var(--warn-text); }
.badge--disetujui { background: var(--success-bg); color: var(--success); }
.badge--ditolak { background: var(--danger-bg); color: var(--danger); }

.action-link { font-size: .84rem; font-weight: 600; margin-right: 12px; }
.action-link--danger { color: var(--danger); }

/* =========================================================
   Project detail
   ========================================================= */
.project-hero { padding: 40px 0 10px; }
.project-hero__meta { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: .9rem; margin-bottom: 10px; }
.project-hero__meta img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: var(--line); }
.project-hero h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.project-hero__desc { max-width: 62ch; color: var(--ink-soft); font-size: 1.02rem; }

.iframe-frame {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 26px 0 10px;
  background: var(--surface);
}
.iframe-frame__bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface-alt); border-bottom: 1px solid var(--line); }
.iframe-frame__stage { position: relative; background: #0d0e12; margin: 0 auto; }
.iframe-frame__stage.stage--lebar  { width: 100%; max-height: 78vh; }
.iframe-frame__stage.stage--tinggi { height: 78vh; max-width: 100%; }
.iframe-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; display: block; }
.btn--fullscreen { margin-left: auto; padding: 6px 14px; font-size: .82rem; gap: 6px; }
.icon-expand { font-size: 1rem; line-height: 1; }
.iframe-hint { color: var(--ink-soft); font-size: .84rem; margin: 0 0 50px; }
.iframe-hint kbd { font-family: var(--font-mono); background: var(--surface-alt); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; font-size: .78rem; }

.iframe-frame.is-fullscreen {
  border: none; border-radius: 0; margin: 0;
  display: flex; flex-direction: column; height: 100vh;
}
.iframe-frame.is-fullscreen .iframe-frame__stage {
  aspect-ratio: unset !important; max-height: none; max-width: none; height: auto; width: auto; flex: 1;
}

/* =========================================================
   Profile page
   ========================================================= */
.profile-hero { padding: 50px 0 30px; display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.profile-hero img { width: 84px; height: 84px; border-radius: 22px; object-fit: cover; background: var(--line); }
.profile-hero h1 { margin-bottom: 4px; }
.profile-hero__jurusan { font-family: var(--font-mono); color: var(--accent); font-size: .85rem; }

@media (max-width: 640px) {
  .site-header__inner { height: 60px; }
  .nav { gap: 12px; font-size: .85rem; }
  .form-card { padding: 24px 18px; margin: 24px auto; }
  .page-head { padding-top: 26px; }
}
