/* =========================================================
   Vina Nuraini — Base layer
   Reset, typography, accessibility primitives
   ========================================================= */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--c-ink);
  color: var(--c-paper);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  font-weight: 400;
  color-scheme: dark;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Paper grain — menyatukan foto, bidang warna, dan tipografi */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='180'%20height='180'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.9'%20numOctaves='3'%20stitchTiles='stitch'/%3E%3C/filter%3E%3Crect%20width='180'%20height='180'%20filter='url(%23n)'%20opacity='0.6'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

body.menu-open,
body.modal-open {
  overflow: hidden;
}

::selection {
  background: var(--c-maroon);
  color: var(--c-paper);
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
ul,
ol,
dl {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 400;
  line-height: 1.15;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

img {
  height: auto;
}

[hidden] {
  display: none !important;
}

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

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--c-paper);
  outline-offset: 3px;
}

[data-theme="light"] :focus-visible {
  outline-color: var(--c-maroon);
}

::placeholder {
  color: rgba(16, 16, 16, 0.38);
  opacity: 1;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  padding: 12px 18px;
  background: var(--c-paper);
  color: var(--c-ink);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

[data-theme="light"] {
  background: var(--c-paper);
  color: var(--c-ink);
}

/* Scroll reveal (only active when JS is available) */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}

html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------------------------------------------------
   Page furniture: frame, side rail, crop marks
   --------------------------------------------------------- */
.page-frame {
  position: fixed;
  inset: var(--frame-inset);
  z-index: 90;
  pointer-events: none;
  border: 1px solid rgba(243, 239, 231, 0.1);
}

.page-frame::before,
.page-frame::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(243, 239, 231, 0.34);
}

.page-frame::before {
  top: -5px;
  left: -5px;
  border-right: 0;
  border-bottom: 0;
}

.page-frame::after {
  right: -5px;
  bottom: -5px;
  border-top: 0;
  border-left: 0;
}

.page-rail {
  position: fixed;
  top: 50%;
  right: calc(var(--frame-inset) + 16px);
  z-index: 80;
  display: none;
  align-items: center;
  gap: 16px;
  color: var(--c-gray);
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
  pointer-events: none;
}

.page-rail b {
  color: var(--c-rose);
  font-weight: 400;
}

@media (min-width: 1280px) {
  .page-rail {
    display: flex;
  }
}

@media (max-width: 899px) {
  .page-frame {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  html.js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
