/* =====================================================================
   ikhlasbellod.com — Porcelain, ink and sage
   ===================================================================== */

:root {
  --porcelain: #F7F7F5;
  --mist:      #E4E6E1;
  --sage:      #6E7F6A;
  --sage-deep: #55634F;
  --stone:     #8A8A85;
  --ink:       #141414;

  --font-body:    "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;

  --gutter: clamp(20px, 5vw, 72px);
  --max: 1320px;
  --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(--porcelain);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
em { font-family: var(--font-display); font-style: italic; font-weight: 400; }
h1, h2, h3 { font-weight: 400; margin: 0; line-height: 1.05; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 3px; }

.eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  margin: 0 0 14px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.6vw, 60px);
  line-height: 1;
}
.section-title em { color: var(--sage-deep); }

/* Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid var(--ink);
  transition: transform .4s var(--ease), background .3s, color .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn-solid { background: var(--ink); color: var(--porcelain); }
.btn-solid:hover { background: var(--sage-deep); border-color: var(--sage-deep); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--mist); }

/* Page veil (load) ---------------------------------------------------- */
.page-veil {
  position: fixed; inset: 0; z-index: 100;
  background: var(--porcelain);
  transform-origin: top;
  animation: veil 1s var(--ease) .1s forwards;
  pointer-events: none;
}
@keyframes veil { to { transform: scaleY(0); } }

/* Header -------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  background: var(--porcelain);
}
@media (min-width: 721px) {
  .site-header {
    background: rgba(247,247,245,.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 500; letter-spacing: 0.01em; }
.brand-mark {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px var(--porcelain), 0 0 0 4px var(--sage);
  transition: transform .5s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(180deg) scale(1.15); }

.site-nav { display: flex; gap: 32px; font-size: 14px; font-weight: 400; }
.site-nav a { position: relative; padding: 4px 0; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease);
}
.site-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-wa { color: var(--sage-deep); font-weight: 500; }

.nav-toggle {
  display: none; width: 40px; height: 40px; position: relative; z-index: 46;
  background: none; border: 0; padding: 0; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 6px;
}
.nav-toggle span { display: block; width: 24px; height: 1.5px; background: var(--ink); transition: transform .35s var(--ease); }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child  { transform: translateY(-3.75px) rotate(-45deg); }

/* Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
  min-height: calc(100vh - 84px);
  padding: 40px var(--gutter) 80px;
  max-width: var(--max);
  margin: 0 auto;
}

/* Crop marks */
.crop { position: absolute; width: 22px; height: 22px; pointer-events: none; opacity: 0; animation: fade 1s .9s forwards; }
.crop::before, .crop::after { content: ""; position: absolute; background: var(--stone); }
.crop::before { width: 100%; height: 1px; }
.crop::after  { width: 1px; height: 100%; }
.crop-tl { top: 24px; left: calc(var(--gutter) - 30px); }
.crop-tr { top: 24px; right: calc(var(--gutter) - 30px); }
.crop-bl { bottom: 40px; left: calc(var(--gutter) - 30px); }
.crop-br { bottom: 40px; right: calc(var(--gutter) - 30px); }
.crop-tl::before, .crop-tr::before { top: 0; }
.crop-bl::before, .crop-br::before { bottom: 0; }
.crop-tl::after, .crop-bl::after { left: 0; }
.crop-tr::after, .crop-br::after { right: 0; }

@keyframes fade { to { opacity: 1; } }

.hero-eyebrow { opacity: 0; animation: rise .9s var(--ease) .5s forwards; }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(64px, 11vw, 148px);
  line-height: .92;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: .05em; }
.hero-title .line > span { display: inline-block; transform: translateY(110%); animation: lineup 1.1s var(--ease) forwards; }
.hero-title .line:nth-child(1) > span { animation-delay: .55s; }
.hero-title .line:nth-child(2) > span { animation-delay: .7s; }
.hero-title em { color: var(--sage-deep); }

@keyframes lineup { to { transform: translateY(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.hero-intro {
  max-width: 44ch;
  font-size: clamp(16px, 1.3vw, 19px);
  color: #3A3A38;
  margin: 0 0 32px;
  opacity: 0; animation: rise .9s var(--ease) .95s forwards;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; opacity: 0; animation: rise .9s var(--ease) 1.1s forwards; }

/* Signature: the pen tool */
.hero-art { position: relative; }
.pen { width: 100%; height: auto; overflow: visible; }
.pen-grid path { stroke: var(--mist); stroke-width: 1; }
.pen-path {
  stroke: var(--ink); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 1000; stroke-dashoffset: 1000;
  animation: draw 2.4s var(--ease) 1.2s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.pen-handles line { stroke: var(--sage); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0; animation: fade .8s 3.2s forwards; }
.pen-anchors rect { fill: var(--porcelain); stroke: var(--ink); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; animation: pop .5s var(--ease) forwards; }
.pen-anchors rect:nth-child(1) { animation-delay: 1.2s; }
.pen-anchors rect:nth-child(2) { animation-delay: 2.3s; }
.pen-anchors rect:nth-child(3) { animation-delay: 3.4s; }
.pen-controls circle { fill: var(--sage); opacity: 0; animation: fade .6s 3.4s forwards; }
@keyframes pop { 0% { opacity: 0; transform: scale(.2); } 60% { opacity: 1; transform: scale(1.3); } 100% { opacity: 1; transform: scale(1); } }

.pen-cursor {
  opacity: 0;
  offset-path: path("M60 330 C 140 60, 220 60, 260 210 S 380 360, 460 90");
  offset-rotate: 0deg;
  animation: travel 2.4s var(--ease) 1.2s forwards, fade .2s 1.2s forwards, drift 5s ease-in-out 3.6s infinite;
}
@supports not (offset-path: path("M0 0")) { .pen-cursor { display: none; } }
@keyframes travel { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@keyframes drift { 0%, 100% { translate: 0 0; } 50% { translate: 6px -8px; } }

.pen-label {
  position: absolute; left: 0; bottom: -6px;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--stone);
  opacity: 0; animation: fade 1s 3.6s forwards;
}

/* Ticker -------------------------------------------------------------- */
.ticker {
  border-top: 1px solid var(--mist); border-bottom: 1px solid var(--mist);
  overflow: hidden; padding: 16px 0;
  font-family: var(--font-display); font-size: 22px; color: var(--stone);
  white-space: nowrap;
}
.ticker-track { display: inline-flex; align-items: center; gap: 28px; animation: ticker 30s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sage); flex: none; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Work ---------------------------------------------------------------- */
.work { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 9vw, 130px) var(--gutter) 40px; }
.section-head { margin-bottom: 40px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.filters a {
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--mist); font-size: 13px; font-weight: 400;
  transition: background .3s, border-color .3s, color .3s;
}
.filters a:hover { border-color: var(--ink); }
.filters a.is-active { background: var(--ink); color: var(--porcelain); border-color: var(--ink); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 3vw, 40px) clamp(20px, 3vw, 32px);
}
.card { display: block; transition: opacity .4s, transform .5s var(--ease); }
.card.is-hidden { display: none; }
.card-wide { grid-column: span 2; }
.card-media { overflow: hidden; background: var(--mist); aspect-ratio: 4 / 3; border-radius: 2px; }
.card-wide .card-media { aspect-ratio: 21 / 9; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter .6s; filter: saturate(.92); }
.card:hover .card-media img { transform: scale(1.04); filter: saturate(1); }
.card-placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-family: var(--font-display); font-size: 96px; color: var(--stone); font-style: italic; }
.card-body { position: relative; padding: 18px 40px 0 0; }
.card-type { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--sage); margin: 0 0 6px; font-weight: 500; }
.card-title { font-family: var(--font-display); font-size: clamp(24px, 2.2vw, 32px); }
.card-summary { color: var(--stone); font-size: 15px; margin: 8px 0 0; max-width: 52ch; }
.card-arrow { position: absolute; right: 0; top: 18px; font-size: 22px; transition: transform .5s var(--ease); }
.card:hover .card-arrow { transform: translateX(6px); }

.empty { padding: 60px 0; color: var(--stone); font-size: 18px; max-width: 48ch; }
.empty a { border-bottom: 1px solid currentColor; color: var(--ink); }

/* About / services ---------------------------------------------------- */
.about { background: var(--mist); margin-top: clamp(72px, 9vw, 130px); }
.about-inner {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(72px, 9vw, 130px) var(--gutter);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 110px);
}
.about-bio { font-size: clamp(17px, 1.35vw, 20px); color: #2F2F2D; max-width: 50ch; margin: 24px 0 0; }

.services { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(20,20,20,.15); }
.service a {
  display: grid; grid-template-columns: 18px 1fr; column-gap: 18px;
  padding: 24px 0; border-bottom: 1px solid rgba(20,20,20,.15);
  transition: padding-left .5s var(--ease);
}
.service a:hover { padding-left: 8px; }
.service-swatch { width: 18px; height: 18px; border-radius: 3px; background: var(--sage); margin-top: 4px; transition: transform .5s var(--ease), border-radius .5s; }
.service a:hover .service-swatch { transform: rotate(45deg); border-radius: 50%; }
.service-name { font-family: var(--font-display); font-size: 26px; line-height: 1.1; }
.service-desc { grid-column: 2; color: #55554F; font-size: 15px; margin-top: 6px; }

/* Footer -------------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--porcelain); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: clamp(80px, 10vw, 140px) var(--gutter) 40px; }
.footer-cta .eyebrow { color: #A9B7A5; }
.footer-title { font-family: var(--font-display); font-size: clamp(40px, 6vw, 88px); line-height: .98; margin-bottom: 40px; }
.footer-title em { color: #A9B7A5; }
.footer-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.site-footer .btn-solid { background: var(--porcelain); color: var(--ink); border-color: var(--porcelain); }
.site-footer .btn-solid:hover { background: #A9B7A5; border-color: #A9B7A5; }
.site-footer .btn-ghost { color: var(--porcelain); border-color: rgba(247,247,245,.35); }
.site-footer .btn-ghost:hover { background: rgba(247,247,245,.08); }

.footer-meta {
  display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 24px;
  margin-top: clamp(60px, 8vw, 110px); padding-top: 28px;
  border-top: 1px solid rgba(247,247,245,.15);
}
.social { list-style: none; display: flex; gap: 24px; margin: 0; padding: 0; font-size: 14px; }
.social a { border-bottom: 1px solid transparent; transition: border-color .3s; }
.social a:hover { border-color: currentColor; }
.footer-fine { display: flex; gap: 24px; margin: 0; font-size: 13px; color: var(--stone); }

/* Floating WhatsApp --------------------------------------------------- */
.wa-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--sage); color: var(--porcelain);
  box-shadow: 0 10px 30px rgba(20,20,20,.18);
  transition: transform .4s var(--ease), background .3s;
  opacity: 0; animation: rise .8s var(--ease) 2s forwards;
}
.wa-float:hover { transform: translateY(-3px) scale(1.05); background: var(--sage-deep); }

/* Project page -------------------------------------------------------- */
.project { max-width: 1100px; margin: 0 auto; padding: 24px var(--gutter) 100px; }
.back { display: inline-block; font-size: 13px; color: var(--sage-deep); font-weight: 500; letter-spacing: .04em; margin-bottom: 40px; }
.project-title { font-family: var(--font-display); font-size: clamp(42px, 7vw, 92px); line-height: .98; opacity: 0; animation: rise 1s var(--ease) .4s forwards; }
.project-summary { font-size: clamp(18px, 1.6vw, 23px); color: #3A3A38; max-width: 60ch; margin: 24px 0 0; opacity: 0; animation: rise 1s var(--ease) .55s forwards; }
.project-meta { display: flex; flex-wrap: wrap; gap: 40px; margin: 40px 0 48px; padding-top: 24px; border-top: 1px solid var(--mist); opacity: 0; animation: rise 1s var(--ease) .7s forwards; }
.project-meta dt { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--stone); margin-bottom: 4px; }
.project-meta dd { margin: 0; font-size: 16px; font-weight: 400; }
.project-cover { margin: 0 0 56px; overflow: hidden; border-radius: 2px; background: var(--mist); }
.project-body { font-size: clamp(17px, 1.3vw, 19px); max-width: 68ch; margin: 0 auto 64px; color: #2F2F2D; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.gallery-item { margin: 0; background: var(--mist); border-radius: 2px; overflow: hidden; }
.gallery-item:nth-child(3n+1) { grid-column: span 2; }
.gallery-item figcaption { font-size: 13px; color: var(--stone); padding: 10px 2px 0; background: var(--porcelain); }
.more { margin-top: 90px; padding-top: 32px; border-top: 1px solid var(--mist); }
.more ul { list-style: none; padding: 0; margin: 0; }
.more li a { display: flex; justify-content: space-between; padding: 18px 0; border-bottom: 1px solid var(--mist); font-family: var(--font-display); font-size: 26px; transition: padding-left .4s var(--ease); }
.more li a:hover { padding-left: 10px; color: var(--sage-deep); }
.notfound { padding: 120px var(--gutter); max-width: var(--max); margin: 0 auto; }
.notfound p { margin-top: 32px; }

/* Scroll reveal ------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.is-visible { opacity: 1; transform: none; }

/* Responsive ---------------------------------------------------------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-bottom: 40px; }
  .hero-art { max-width: 520px; }
  .about-inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .site-header { padding: 16px var(--gutter); }
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed; inset: 0; top: 0; z-index: -1;
    flex-direction: column; justify-content: center; align-items: flex-start;
    padding: 0 var(--gutter); gap: 28px;
    background: var(--porcelain);
    font-family: var(--font-display); font-size: 40px;
    opacity: 0; pointer-events: none;
    transition: opacity .4s var(--ease);
  }
  .site-nav a::after { display: none; }
  .site-nav.is-open { opacity: 1; pointer-events: auto; z-index: 45; }
  .hero-title { font-size: clamp(60px, 20vw, 96px); }
  .crop { display: none; }
  .grid { grid-template-columns: 1fr; }
  .card-wide { grid-column: auto; }
  .card-wide .card-media { aspect-ratio: 4 / 3; }
  .gallery { grid-template-columns: 1fr; }
  .gallery-item:nth-child(3n+1) { grid-column: auto; }
  .footer-meta { flex-direction: column; align-items: flex-start; }
  .wa-float { right: 16px; bottom: 16px; width: 50px; height: 50px; }
  .ticker { font-size: 18px; }
}

/* Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .pen-path { stroke-dashoffset: 0; }
  .pen-cursor, .pen-handles line, .pen-anchors rect, .pen-controls circle, .pen-label, .crop, .hero-eyebrow, .hero-intro, .hero-actions, .wa-float, .project-title, .project-summary, .project-meta { opacity: 1; }
  .hero-title .line > span { transform: none; }
  .page-veil { display: none; }
}
