/* =========================================================
   daffaghifarii.com — minimalis hitam-putih, gerak ala Apple
   ========================================================= */
:root {
  --paper: #FDFDFC;
  --ink: #161616;
  --ink-soft: #4A4A48;
  --mute: #8C8C88;
  --line: #E7E7E4;
  --stone: #EEEEEB;
  --note: #F7EC9C;
  --note-edge: #EADB79;

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;

  --gutter: clamp(20px, 5vw, 64px);
  --max: 1200px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--mute); }
.section-title { font-size: clamp(40px, 6vw, 76px); line-height: 1; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 22px; border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font: 500 15px/1 var(--sans); text-decoration: none;
  border: 1px solid var(--ink); cursor: pointer;
  transition: transform .4s var(--ease), background .3s, color .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-big { padding: 18px 32px; font-size: 16px; }
.link {
  font-weight: 500; text-decoration: none; font-size: 15px;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 2px; transition: background-size .4s var(--ease);
}
.link:hover { background-size: 0 1px; background-position: 100% 100%; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  transition: transform .5s var(--ease), background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(253,253,252,.78); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); border-color: var(--line); }
.nav.hidden { transform: translateY(-100%); }
.nav-logo { font-family: var(--serif); font-size: 22px; text-decoration: none; letter-spacing: .01em; }
.nav-links { display: flex; gap: 28px; align-items: center; font-size: 14px; }
.nav-links a { text-decoration: none; color: var(--ink-soft); transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
.nav-links .nav-cta { color: var(--ink); border: 1px solid var(--ink); padding: 8px 14px; border-radius: 999px; }
.nav-toggle { display: none; background: none; border: 0; width: 36px; height: 36px; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 8px; right: 8px; height: 1.5px; background: var(--ink); transition: transform .3s var(--ease); }
.nav-toggle span:first-child { top: 14px; }
.nav-toggle span:last-child { top: 21px; }
.nav.open .nav-toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav.open .nav-toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- Photo placeholder ---------- */
.photo-placeholder {
  position: relative; background: var(--stone); overflow: hidden;
  aspect-ratio: 4 / 5;
}
.photo-placeholder::after {
  content: attr(data-label); position: absolute; left: 16px; bottom: 14px;
  font-size: 12px; color: var(--mute);
}
.photo-placeholder:has(img)::after { content: none; }
.photo-placeholder img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.photo-placeholder.dark { background: #2A2A28; }
.photo-placeholder.dark::after { color: #8A8A86; }
.photo-placeholder.tall { aspect-ratio: 3 / 4; }

/* ---------- Hero ---------- */
.hero { min-height: 100svh; display: flex; align-items: center; position: relative; padding: 110px 0 60px; }
.hero-inner {
  width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(32px, 6vw, 96px); align-items: center;
}
.hero-text { will-change: transform, opacity; }
.hero-name { font-size: clamp(64px, 10vw, 148px); line-height: .9; letter-spacing: -0.025em; }
.hero-name .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-name .line > span { display: inline-block; transform: translateY(105%); animation: rise 1.3s var(--ease) forwards; }
.hero-name .line:nth-child(2) > span { animation-delay: .12s; font-style: italic; }
.hero-role, .hero-lead { opacity: 0; animation: fade 1.2s var(--ease) .6s forwards; }
.hero-role { margin-top: 28px; font-size: 15px; font-weight: 500; }
.hero-lead { margin-top: 10px; max-width: 34ch; color: var(--ink-soft); }
.hero-photo { margin: 0; clip-path: inset(100% 0 0 0); animation: unveil 1.6s var(--ease) .2s forwards; }
.hero-photo .photo-placeholder { aspect-ratio: 5 / 4; will-change: transform; }
.scroll-hint { position: absolute; left: 50%; bottom: 28px; width: 1px; height: 48px; background: var(--line); overflow: hidden; }
.scroll-hint span { position: absolute; inset: 0; background: var(--ink); animation: drip 2.2s var(--ease) infinite; }

@keyframes rise { to { transform: translateY(0); } }
@keyframes fade { to { opacity: 1; } }
@keyframes unveil { to { clip-path: inset(0 0 0 0); } }
@keyframes drip { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* ---------- Manifesto (word reveal) ---------- */
.manifesto { height: 260vh; position: relative; }
.manifesto-sticky { position: sticky; top: 0; height: 100svh; display: flex; align-items: center; justify-content: center; padding: 0 var(--gutter); }
.manifesto-text { font-family: var(--serif); font-size: clamp(36px, 5.6vw, 84px); line-height: 1.08; max-width: 18ch; text-align: center; letter-spacing: -0.015em; }
.manifesto-text .w { color: #D6D6D2; transition: color .35s ease; }
.manifesto-text .w.on { color: var(--ink); }

/* ---------- About ---------- */
.about { padding: 120px 0 40px; }
.about-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.about-photo { margin: 0; position: sticky; top: 100px; }
.about-tags { margin: 22px 0 32px; font-size: 14px; color: var(--mute); }
.prose p { font-family: var(--serif); font-size: clamp(20px, 1.8vw, 24px); line-height: 1.55; color: var(--ink-soft); max-width: 36em; }
.prose p + p { margin-top: 1.1em; }

/* stacking facet cards */
.facets { padding-top: 140px; }
.facets-intro { font-size: 15px; color: var(--mute); margin-bottom: 28px; }
.facet-stack { display: grid; gap: 24px; }
.facet {
  position: sticky; top: calc(110px + var(--i, 0) * 22px);
  background: var(--paper); border: 1px solid var(--line);
  padding: clamp(32px, 5vw, 64px); min-height: 46vh;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  transform-origin: center top;
}
.facet:nth-child(1) { --i: 0; }
.facet:nth-child(2) { --i: 1; }
.facet:nth-child(3) { --i: 2; }
.facet:nth-child(4) { --i: 3; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.facet h3 { font-size: clamp(40px, 6vw, 88px); line-height: .95; }
.facet p { max-width: 38ch; font-size: 18px; color: inherit; opacity: .75; }

/* ---------- Numbers ---------- */
.numbers { padding: 160px 0 120px; }
.numbers-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; border-top: 1px solid var(--ink); padding-top: 32px; }
.num strong { display: block; font: 400 clamp(56px, 7vw, 104px)/1 var(--serif); letter-spacing: -0.02em; }
.num span { display: block; margin-top: 12px; font-size: 14px; color: var(--mute); max-width: 20ch; }

/* ---------- Work: horizontal pinned ---------- */
.work { position: relative; }
.work-sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 40px; }
.work-head { width: 100%; display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.work-head .muted { max-width: 30ch; font-size: 15px; }
.work-track { display: flex; gap: 32px; padding: 0 var(--gutter); will-change: transform; width: max-content; }
.case { width: min(78vw, 820px); display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: end; flex-shrink: 0; }
.case-media { aspect-ratio: 4 / 5; }
.case-body { padding-bottom: 8px; }
.case h3 { font-size: clamp(34px, 3.6vw, 52px); line-height: 1; margin: 16px 0 6px; }
.case-kind { font-size: 14px; color: var(--mute); margin-bottom: 18px; }
.case p:not(.case-kind) { color: var(--ink-soft); margin-bottom: 22px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.status.dev::before { background: transparent; border: 1.5px solid var(--ink); }
.work-progress { margin: 0 var(--gutter); height: 1px; background: var(--line); position: relative; max-width: calc(var(--max) - 2 * var(--gutter)); width: calc(100% - 2 * var(--gutter)); align-self: center; }
.work-progress span { position: absolute; inset: 0; background: var(--ink); transform-origin: left; transform: scaleX(0); }

/* ---------- Brands: zoom on scroll ---------- */
.brands { padding: 140px 0 60px; }
.brands .section-title { margin-bottom: 60px; }
.brand { height: 170vh; position: relative; }
.brand-frame { position: sticky; top: 0; height: 100svh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.brand-visual {
  position: absolute; inset: 0; aspect-ratio: auto;
  clip-path: inset(var(--inset, 18%) round var(--radius, 24px));
  transform: scale(var(--scale, 1.12));
  will-change: clip-path, transform;
}
.brand-visual::after { left: 50%; transform: translateX(-50%); bottom: 24%; }
.brand-copy { position: relative; text-align: center; color: var(--paper); opacity: var(--copy, 0); transform: translateY(calc((1 - var(--copy, 0)) * 30px)); }
.brand-visual:not(.dark) + .brand-copy { color: var(--ink); }
.brand-copy h3 { font-size: clamp(64px, 11vw, 168px); line-height: .9; font-style: italic; }
.brand-copy p { margin: 18px auto 30px; max-width: 30ch; font-size: 18px; opacity: .85; }
.brand-visual:not(.dark) + .brand-copy .btn-light { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- Writing ---------- */
.writing { padding: 140px 0 100px; }
.writing-head { display: flex; justify-content: space-between; align-items: end; gap: 32px; }
.writing-head .muted { max-width: 34ch; font-size: 15px; }
.filters { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: 56px 0 8px; padding-bottom: 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid transparent; background: none; padding: 8px 14px; border-radius: 999px; font: 500 14px var(--sans); color: var(--ink-soft); cursor: pointer; transition: all .25s; }
.chip sup { font-size: 10px; margin-left: 3px; color: var(--mute); }
.chip:hover { border-color: var(--line); }
.chip.active { background: var(--ink); color: var(--paper); }
.chip.active sup { color: #BDBDB8; }
.search input { width: 240px; border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; font: 14px var(--sans); background: transparent; color: var(--ink); }
.search input:focus { outline: none; border-color: var(--ink); }
.posts { list-style: none; margin: 0; padding: 0; }
.post a {
  display: grid; grid-template-columns: 140px 1fr auto; gap: 32px; align-items: baseline;
  padding: 34px 0; border-bottom: 1px solid var(--line); text-decoration: none;
  transition: padding .5s var(--ease);
}
.post a:hover { padding-left: 14px; }
.post-meta { font-size: 13px; color: var(--mute); line-height: 1.5; }
.post-meta b { display: block; font-weight: 500; color: var(--ink); }
.post h3 { font-size: clamp(28px, 3vw, 42px); line-height: 1.1; }
.post p { margin-top: 8px; color: var(--ink-soft); font-size: 16px; }
.post-read { font-size: 13px; color: var(--mute); white-space: nowrap; }
.empty { padding: 48px 0; color: var(--mute); }

/* ---------- Books ---------- */
.books { padding: 120px 0 160px; background: var(--stone); }
.books > .container > .muted { margin-top: 16px; }
.books-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); margin-top: 72px; }
.book { display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: end; }
.book-cover { perspective: 1000px; }
.cover {
  width: clamp(150px, 15vw, 210px); aspect-ratio: 3171 / 4500; padding: 22px 18px;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.35), inset 4px 0 0 rgba(255,255,255,.08), inset 6px 0 8px -4px rgba(0,0,0,.25);
  transform: rotateY(var(--ry, -14deg)) rotateX(var(--rx, 4deg));
  transition: transform .6s var(--ease); border-radius: 2px 6px 6px 2px;
}
.cover-a { background: var(--ink); color: var(--paper); }
.cover-b { background: var(--paper); color: var(--ink); }
.cover-photo { padding: 0; aspect-ratio: 3171 / 4500; overflow: hidden; background: var(--stone); }
.cover-photo img { width: 100%; height: 100%; object-fit: cover; }
.book-series { font-size: 13px; color: var(--mute); margin: 0 0 8px !important; }
.cover-title { font: italic 400 26px/1 var(--serif); }
.cover-author { font-size: 11px; letter-spacing: .04em; }
.book-info h3 { font-size: 32px; line-height: 1.05; }
.book-info p { margin: 12px 0 22px; color: var(--ink-soft); font-size: 16px; max-width: 30ch; }
.book-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Dream wall ---------- */
.wall-intro { padding: 160px 0 80px; text-align: center; }
.wall-intro-inner { max-width: 760px; }
.wall-title { font-size: clamp(42px, 6vw, 84px); line-height: 1.02; }
.wall-intro p { margin: 26px auto 40px; max-width: 46ch; color: var(--ink-soft); }
.wall { padding: 20px 0 160px; background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 22px 22px; }
.wall-count { text-align: center; font-size: 14px; margin-bottom: 48px; }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 36px 28px; }
.note {
  position: relative; background: var(--note); padding: 34px 24px 26px; min-height: 210px;
  text-align: left; border: 0; cursor: pointer; font: inherit; color: var(--ink);
  transform: rotate(var(--r, 0deg)); box-shadow: 0 14px 24px -14px rgba(0,0,0,.35);
  background-image: linear-gradient(135deg, transparent 88%, var(--note-edge) 88%);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
  opacity: 0; translate: 0 40px;
}
.note.in { opacity: 1; translate: 0 0; transition: transform .5s var(--ease), box-shadow .5s var(--ease), opacity .8s var(--ease) var(--d, 0s), translate .8s var(--ease) var(--d, 0s); }
.note::before { content: ""; position: absolute; top: -10px; left: 50%; width: 84px; height: 22px; transform: translateX(-50%) rotate(-2deg); background: rgba(225, 215, 190, .75); }
.note:hover { transform: rotate(0deg) scale(1.03); box-shadow: 0 22px 34px -16px rgba(0,0,0,.4); z-index: 2; }
.note.new { animation: stick .9s var(--ease); }
@keyframes stick { 0% { transform: translateY(-60px) rotate(-12deg) scale(1.15); opacity: 0; } 100% { transform: rotate(var(--r)); opacity: 1; } }
.note-to { font-size: 11px; letter-spacing: .06em; color: var(--ink-soft); }
.note-to b { font-weight: 600; color: var(--ink); }
.note-msg { margin-top: 14px; font: 500 25px/1.15 var(--hand); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.note-date { margin-top: 16px; font-size: 11px; color: var(--ink-soft); }

/* ---------- Modal ---------- */
.modal { border: 0; padding: 0; background: transparent; max-width: min(520px, calc(100vw - 32px)); width: 100%; }
.modal::backdrop { background: rgba(22,22,22,.45); backdrop-filter: blur(6px); }
.modal[open] .modal-card { animation: pop .6s var(--ease); }
@keyframes pop { from { transform: translateY(24px) scale(.97); opacity: 0; } }
.modal-card { position: relative; background: var(--paper); padding: 40px 32px 32px; display: grid; gap: 18px; border-radius: 4px; }
.modal-card h3 { font-size: 38px; }
.modal-card label { display: grid; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.modal-card input, .modal-card textarea { font: 16px/1.5 var(--sans); padding: 12px 14px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); resize: vertical; }
.modal-card input:focus, .modal-card textarea:focus { outline: none; border-color: var(--ink); }
.modal-card .hint { font-size: 12px; color: var(--mute); margin-top: -10px; }
.modal-close { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--ink-soft); }
.note-full { background: var(--note); padding: 48px 36px 36px; }
.note-full .note-msg { font-size: 32px; -webkit-line-clamp: unset; display: block; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 200%); background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 999px; font-size: 14px; transition: transform .6s var(--ease), opacity .4s; opacity: 0; pointer-events: none; z-index: 90; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Contact ---------- */
.contact { background: var(--ink); color: var(--paper); padding: 160px 0 48px; }
.contact-title { font-size: clamp(52px, 9vw, 140px); line-height: .95; max-width: 11ch; }
.contact-mail { display: inline-block; margin-top: 48px; font: italic 400 clamp(26px, 3vw, 40px) var(--serif); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.3); transition: border-color .3s; }
.contact-mail:hover { border-color: var(--paper); }
.socials { display: flex; gap: 28px; margin-top: 40px; font-size: 15px; }
.socials a { text-decoration: none; opacity: .7; transition: opacity .2s; }
.socials a:hover { opacity: 1; }
.fine { margin-top: 120px; font-size: 12px; opacity: .45; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: flex-start; gap: 18px;
    background: var(--paper); padding: 24px var(--gutter) 32px; border-bottom: 1px solid var(--line);
    transform: translateY(-120%); transition: transform .5s var(--ease); font-size: 18px; z-index: -1;
  }
  .nav.open .nav-links { transform: none; }
  .nav.open { background: var(--paper); }
  .hero-inner, .about-grid { grid-template-columns: 1fr; }
  .hero-photo { order: -1; }
  .about-photo { position: static; max-width: 420px; }
  .numbers-grid { grid-template-columns: repeat(2, 1fr); row-gap: 48px; }
  .case { width: 82vw; grid-template-columns: 1fr; gap: 20px; }
  .case-media { aspect-ratio: 16 / 10; }
  .work-head { flex-direction: column; align-items: start; }
  .writing-head { flex-direction: column; align-items: start; }
  .post a { grid-template-columns: 1fr; gap: 10px; }
  .post-meta b { display: inline; margin-right: 8px; }
  .search input { width: 100%; }
  .search { width: 100%; }
  .books-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .book { grid-template-columns: 1fr; }
  .case h3 { font-size: 32px; }
  .facet { min-height: 40vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal, .note { opacity: 1; transform: none; translate: none; }
  .manifesto { height: auto; }
  .manifesto-sticky { position: static; height: auto; padding: 120px var(--gutter); }
  .manifesto-text .w { color: var(--ink); }
}
