/* ---------- pola tradisional (dipakai ulang lintas section) ----------
   --pat-asanoha : daun rami, dipakai sebagai MASK (warna ikut token).
   --pat-seigaiha-*: ombak biru-laut. Ombak butuh lapisan yang saling
     menutup, jadi warnanya tertanam di SVG — kalau --sumi/--bg-dark/--ai
     di tokens.css diubah, samakan juga hex di dua pola ini.
   --pat-grain   : serat kertas washi (noise halus).
   ------------------------------------------------------ */
:root{
  --pat-asanoha:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='69.28' viewBox='0 0 40 69.28'%3E%3Cpath d='M-40 0L-40 23.09M-60 34.64L-40 23.09M-20 34.64L-40 23.09M-40 0L-60 34.64M-60 34.64L-20 34.64M-20 34.64L-40 0M0 0L0 23.09M-20 34.64L0 23.09M20 34.64L0 23.09M0 0L-20 34.64M-20 34.64L20 34.64M20 34.64L0 0M40 0L40 23.09M20 34.64L40 23.09M60 34.64L40 23.09M40 0L20 34.64M20 34.64L60 34.64M60 34.64L40 0M-20 34.64L-20 11.55M-40 0L-20 11.55M0 0L-20 11.55M-40 0L0 0M20 34.64L20 11.55M0 0L20 11.55M40 0L20 11.55M0 0L40 0M60 34.64L60 11.55M40 0L60 11.55M-20 34.64L-20 57.74M-40 69.28L-20 57.74M0 69.28L-20 57.74M-20 34.64L-40 69.28M-40 69.28L0 69.28M0 69.28L-20 34.64M20 34.64L20 57.74M0 69.28L20 57.74M40 69.28L20 57.74M20 34.64L0 69.28M0 69.28L40 69.28M40 69.28L20 34.64M60 34.64L60 57.74M40 69.28L60 57.74M0 69.28L0 46.19M-20 34.64L0 46.19M20 34.64L0 46.19M40 69.28L40 46.19M20 34.64L40 46.19M60 34.64L40 46.19' fill='none' stroke='black' stroke-width='.8'/%3E%3C/svg%3E");
  --pat-seigaiha-marquee:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20'%3E%3Cg fill='%2315120F' stroke='rgba(237,230,214,.09)' stroke-width='1.1'%3E%3Ccircle cx='20' cy='-10' r='19.5'/%3E%3Ccircle cx='20' cy='-10' r='14.5'/%3E%3Ccircle cx='20' cy='-10' r='9.5'/%3E%3Ccircle cx='20' cy='-10' r='4.5'/%3E%3Ccircle cx='0' cy='0' r='19.5'/%3E%3Ccircle cx='0' cy='0' r='14.5'/%3E%3Ccircle cx='0' cy='0' r='9.5'/%3E%3Ccircle cx='0' cy='0' r='4.5'/%3E%3Ccircle cx='40' cy='0' r='19.5'/%3E%3Ccircle cx='40' cy='0' r='14.5'/%3E%3Ccircle cx='40' cy='0' r='9.5'/%3E%3Ccircle cx='40' cy='0' r='4.5'/%3E%3Ccircle cx='20' cy='10' r='19.5'/%3E%3Ccircle cx='20' cy='10' r='14.5'/%3E%3Ccircle cx='20' cy='10' r='9.5'/%3E%3Ccircle cx='20' cy='10' r='4.5'/%3E%3Ccircle cx='0' cy='20' r='19.5'/%3E%3Ccircle cx='0' cy='20' r='14.5'/%3E%3Ccircle cx='0' cy='20' r='9.5'/%3E%3Ccircle cx='0' cy='20' r='4.5'/%3E%3Ccircle cx='40' cy='20' r='19.5'/%3E%3Ccircle cx='40' cy='20' r='14.5'/%3E%3Ccircle cx='40' cy='20' r='9.5'/%3E%3Ccircle cx='40' cy='20' r='4.5'/%3E%3Ccircle cx='20' cy='30' r='19.5'/%3E%3Ccircle cx='20' cy='30' r='14.5'/%3E%3Ccircle cx='20' cy='30' r='9.5'/%3E%3Ccircle cx='20' cy='30' r='4.5'/%3E%3C/g%3E%3C/svg%3E");
  --pat-seigaiha-footer:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20'%3E%3Cg fill='%2312100E' stroke='%232E3F5C' stroke-width='1.1'%3E%3Ccircle cx='20' cy='-10' r='19.5'/%3E%3Ccircle cx='20' cy='-10' r='14.5'/%3E%3Ccircle cx='20' cy='-10' r='9.5'/%3E%3Ccircle cx='20' cy='-10' r='4.5'/%3E%3Ccircle cx='0' cy='0' r='19.5'/%3E%3Ccircle cx='0' cy='0' r='14.5'/%3E%3Ccircle cx='0' cy='0' r='9.5'/%3E%3Ccircle cx='0' cy='0' r='4.5'/%3E%3Ccircle cx='40' cy='0' r='19.5'/%3E%3Ccircle cx='40' cy='0' r='14.5'/%3E%3Ccircle cx='40' cy='0' r='9.5'/%3E%3Ccircle cx='40' cy='0' r='4.5'/%3E%3Ccircle cx='20' cy='10' r='19.5'/%3E%3Ccircle cx='20' cy='10' r='14.5'/%3E%3Ccircle cx='20' cy='10' r='9.5'/%3E%3Ccircle cx='20' cy='10' r='4.5'/%3E%3Ccircle cx='0' cy='20' r='19.5'/%3E%3Ccircle cx='0' cy='20' r='14.5'/%3E%3Ccircle cx='0' cy='20' r='9.5'/%3E%3Ccircle cx='0' cy='20' r='4.5'/%3E%3Ccircle cx='40' cy='20' r='19.5'/%3E%3Ccircle cx='40' cy='20' r='14.5'/%3E%3Ccircle cx='40' cy='20' r='9.5'/%3E%3Ccircle cx='40' cy='20' r='4.5'/%3E%3Ccircle cx='20' cy='30' r='19.5'/%3E%3Ccircle cx='20' cy='30' r='14.5'/%3E%3Ccircle cx='20' cy='30' r='9.5'/%3E%3Ccircle cx='20' cy='30' r='4.5'/%3E%3C/g%3E%3C/svg%3E");
  --pat-grain:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .93 0 0 0 0 .9 0 0 0 0 .84 0 0 0 .7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- reset & tipografi ---------- */
*{margin:0;padding:0;box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  background-color:var(--bg-dark);
  color:var(--text-light);
  font-family:var(--font-body);
  overflow-x:hidden;
  line-height:1.6;
  counter-reset:shou; /* nomor bab 第一章, 第二章 … di judul section */
}
/* serat kertas washi di atas seluruh halaman — sangat halus, tidak menangkap klik */
body::after{
  content:"";position:fixed;inset:0;z-index:300;pointer-events:none;
  background-image:var(--pat-grain);opacity:.05;
}
::selection{background:var(--shu);color:var(--washi);}
.sr-defs{position:absolute;width:0;height:0;overflow:hidden;}

/* ---------- nav ---------- */
nav{
  position:fixed;top:0;left:0;right:0;z-index:50;
  display:flex;align-items:center;justify-content:space-between;
  padding:18px 56px;
  background:rgba(18,16,14,.82);backdrop-filter:blur(12px);
}
/* garis bawah nav: tipis kincha dengan ujung meruncing seperti bilah */
nav::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:1px;
  background:linear-gradient(90deg,transparent,var(--kincha-dim) 12%,var(--kincha-dim) 88%,transparent);
}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--text-light);}
/* mon (lambang keluarga): lingkaran vermilion + cincin emas tipis */
.brand-mark{
  width:36px;height:36px;border-radius:50%;background:var(--shu);
  display:grid;place-items:center;color:var(--washi);
  font-family:var(--font-brush);font-size:19px;line-height:1;
  box-shadow:0 0 0 2px var(--bg-dark),0 0 0 3px var(--kincha);
  transition:transform .6s var(--ease-slash);
}
.brand:hover .brand-mark{transform:rotate(360deg);}
.brand-name{font-family:var(--font-display);font-weight:800;font-size:18px;letter-spacing:.14em;}
.nav-links{display:flex;gap:34px;list-style:none;}
.nav-links a{
  text-decoration:none;color:var(--text-light);font-size:13px;font-weight:700;
  letter-spacing:.16em;text-transform:uppercase;position:relative;padding:4px 0;
  transition:color .25s ease;
}
/* garis bawah = sapuan kuas yang meruncing di ujung */
.nav-links a::after{
  content:"";position:absolute;left:0;bottom:-5px;width:100%;height:3px;
  background:var(--shu);
  clip-path:polygon(0 40%,100% 0,96% 100%,0 70%);
  transform:scaleX(0);transform-origin:left;transition:transform .45s var(--ease-slash);
}
.nav-links a:hover{color:var(--washi);}
.nav-links a:hover::after{transform:scaleX(1);}
@media(max-width:760px){
  nav{padding:14px 20px;}
  .nav-links{display:none;}
}

/* ---------- hero ---------- */
.hero{
  min-height:calc(100vh - var(--nav-h));margin-top:var(--nav-h);position:relative;
  display:grid;grid-template-columns:.95fr 1.3fr .95fr;
  align-items:center;gap:24px;
  padding:40px 72px 40px 96px;
  scroll-margin-top:var(--scroll-offset);
  background:var(--bg-dark);color:var(--text-light);
  overflow:hidden;isolation:isolate;
}
/* pola asanoha samar yang memudar dari tengah (di belakang matahari) */
.hero::before{
  content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:var(--kincha);opacity:.09;
  -webkit-mask-image:var(--pat-asanoha),radial-gradient(ellipse 55% 60% at 50% 48%,#000 0%,transparent 75%);
  mask-image:var(--pat-asanoha),radial-gradient(ellipse 55% 60% at 50% 48%,#000 0%,transparent 75%);
  -webkit-mask-size:40px 69.28px,100% 100%;mask-size:40px 69.28px,100% 100%;
  -webkit-mask-composite:source-in;mask-composite:intersect;
}
/* tulisan vertikal ala gulungan (tategaki) di tepi kiri hero */
.hero-vertical{
  position:absolute;left:30px;top:50%;transform:translateY(-50%);z-index:1;
  writing-mode:vertical-rl;
  font-family:var(--font-brush);font-size:22px;letter-spacing:.5em;white-space:nowrap;
  color:var(--text-dim);opacity:.55;
  display:flex;align-items:center;gap:22px;
}
.hero-vertical::before,.hero-vertical::after{
  content:"";width:1px;height:70px;
  background:linear-gradient(var(--kincha-dim),transparent);
}
.hero-vertical::before{background:linear-gradient(transparent,var(--kincha-dim));}
.hero-left,.hero-right{position:relative;z-index:2;}
.hero-eyebrow{
  display:flex;align-items:center;gap:12px;
  font-family:var(--font-body);font-size:12.5px;font-weight:700;letter-spacing:.12em;
  text-transform:uppercase;color:var(--shu-bright);margin-bottom:20px;
}
.hero-eyebrow::before{content:"";width:28px;height:1px;background:var(--shu-bright);}
.hero h1{
  font-family:var(--font-display);font-weight:800;color:var(--text-light);
  font-size:clamp(44px,5vw,72px);line-height:1.08;letter-spacing:.01em;
}
.hero h1 .red{color:var(--shu-bright);}
/* katana di bawah nama — menggantikan garis pemisah biasa */
.hero-divider{width:min(260px,100%);margin:24px 0 22px;position:relative;}
.hero-divider svg{display:block;width:100%;height:auto;overflow:visible;filter:drop-shadow(0 4px 8px rgba(0,0,0,.5));}
.k-kin{fill:var(--kincha);}
.k-tsuka{fill:var(--sumi);}
.k-ito{fill:var(--washi-deep);}
.k-blade{fill:url(#bladeGrad);}
.k-stop-hi{stop-color:var(--washi);}
.k-stop-mid{stop-color:var(--hagane);}
.k-stop-lo{stop-color:var(--ink-gray);}
.k-hamon{fill:none;stroke:#fff;stroke-width:.7;opacity:.75;}
.k-shinogi{fill:none;stroke:var(--sumi);stroke-width:.35;opacity:.45;}
.hero-bio{font-size:15px;color:var(--text-dim);max-width:400px;}
.hero-bio b{color:var(--text-light);}
.hero .hero-social-link{color:var(--text-light);}
.hero .hero-social-link:hover{color:var(--shu-bright);}

/* center portrait + matahari tinta + ensō */
.portrait-wrap{position:relative;display:grid;place-items:center;min-height:680px;overflow:visible;}
/* hinomaru: matahari bengara dengan tepi sapuan tinta (filter #inkEdge) */
.hinomaru{
  position:absolute;width:min(560px,62%);aspect-ratio:1;
  color:var(--aka);z-index:1;pointer-events:none;
}
.hinomaru svg{width:100%;height:100%;display:block;overflow:visible;}
/* ensō — lingkaran kuas zen yang sengaja tidak tertutup, berputar sangat pelan */
.enso{
  position:absolute;width:min(660px,74%);aspect-ratio:1;z-index:1;pointer-events:none;
  color:var(--washi);opacity:.2;
  animation:ensoSpin 90s linear infinite;
}
.enso svg{width:100%;height:100%;display:block;overflow:visible;}
@keyframes ensoSpin{to{transform:rotate(360deg);}}
/* foto hero: cutout PNG transparan tanpa bingkai (default) atau fallback persegi */
.portrait{
  position:relative;z-index:2;width:min(760px,94%);
  display:grid;place-items:center;
}
.portrait--cutout img{
  width:100%;height:auto;display:block;object-fit:contain;
  filter:drop-shadow(0 22px 44px rgba(0,0,0,.45));
  -webkit-mask-image:linear-gradient(to bottom, #000 92%, rgba(0,0,0,0) 100%);
  mask-image:linear-gradient(to bottom, #000 92%, rgba(0,0,0,0) 100%);
}
.portrait--square{
  aspect-ratio:3/3.6;overflow:hidden;background:var(--sumi);
  box-shadow:0 24px 60px rgba(0,0,0,.4);
}
.portrait--square img{width:100%;height:100%;object-fit:cover;display:block;}
.portrait-fallback{
  width:100%;aspect-ratio:3/3.6;background:var(--sumi);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;
  color:var(--washi);text-align:center;font-family:var(--font-display);
  box-shadow:0 24px 60px rgba(0,0,0,.4);
}
.portrait-fallback .kanji{font-family:var(--font-brush);font-size:84px;color:var(--shu-bright);display:block;line-height:1;}
.portrait-fallback span{font-size:12px;letter-spacing:.3em;color:rgba(237,230,214,.55);}
/* caption lokasi: label kayu kecil (fuda) dengan cap merah di kiri */
.portrait-caption{
  position:absolute;bottom:6px;z-index:3;
  display:flex;align-items:center;gap:10px;
  font-family:var(--font-body);font-size:12px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;
  background:var(--bg-dark-2);color:var(--text-light);
  border:1px solid var(--kincha-dim);
  padding:8px 16px 8px 10px;
  clip-path:polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px);
}
.portrait-caption::before{
  content:"";width:9px;height:9px;background:var(--shu);transform:rotate(45deg);
}

/* right column stats — nomor kanji 壱 弐 参 lewat counter CSS */
.hero-right{display:flex;flex-direction:column;gap:26px;align-items:flex-start;counter-reset:stat;}
.stat{position:relative;padding-left:46px;counter-increment:stat;}
.stat::before{
  content:counter(stat, cjk-decimal);
  position:absolute;left:0;top:2px;
  font-family:var(--font-brush);font-size:22px;line-height:1;color:var(--shu-bright);
}
.stat::after{
  content:"";position:absolute;left:10px;top:34px;bottom:4px;width:1px;
  background:linear-gradient(var(--kincha-dim),transparent);
}
.stat .num{
  font-family:var(--font-display);font-weight:800;
  font-size:clamp(38px,3.8vw,56px);line-height:1;
}
.stat .label{font-family:var(--font-body);font-size:13.5px;font-weight:500;letter-spacing:.01em;color:var(--text-dim);margin-top:4px;}
.cta-row{display:flex;gap:14px;flex-wrap:wrap;margin-top:8px;}

/* ---------- sections ---------- */
section{padding:32px 72px 96px;scroll-margin-top:var(--scroll-offset);position:relative;}
@media(max-width:760px){section{padding:28px 22px 70px;}}
/* kepala section: cap hanko vertikal + nomor bab + judul */
.section-head{
  display:flex;flex-direction:row;align-items:center;gap:22px;margin-bottom:52px;
  counter-increment:shou;
}
.section-kanji{
  flex:0 0 auto;
  writing-mode:vertical-rl;
  font-family:var(--font-brush);font-size:21px;line-height:1;letter-spacing:.08em;
  color:var(--washi);background:var(--shu);
  padding:12px 9px;border-radius:5px;
  transform:rotate(-4deg);
  box-shadow:inset 0 0 0 2px var(--shu),inset 0 0 0 3.5px rgba(237,230,214,.75);
  filter:url(#stampEdge); /* tepi tinta cap yang tidak rata (filter SVG di index.html) */
}
.section-title{
  font-family:var(--font-display);font-weight:800;
  font-size:clamp(30px,3.6vw,46px);letter-spacing:.01em;line-height:1.15;
}
.section-title::before{
  content:"第" counter(shou, cjk-decimal) "章";
  display:block;margin-bottom:6px;
  font-family:var(--font-display);font-weight:700;font-size:13px;letter-spacing:.5em;
  color:var(--kincha);
}

/* pemisah antar-section: sapuan kuas tinta (lihat <symbol id="brushStroke">) */
.brush-divider{
  display:flex;justify-content:center;align-items:center;gap:18px;
  padding:0 72px;margin:0 auto;max-width:1200px;
}
.brush-divider svg{flex:1;height:22px;color:var(--shu);opacity:.85;}
.brush-divider svg:last-child{transform:scaleX(-1);}
/* mon kecil di tengah pemisah */
.brush-divider .bd-mark{
  flex:0 0 auto;width:12px;height:12px;border-radius:50%;background:var(--shu);
  box-shadow:0 0 0 4px var(--bg-dark),0 0 0 5px var(--kincha);
}
@media(max-width:760px){.brush-divider{padding:0 22px;}}

/* ---------- tools section ---------- */
#tools{background:var(--bg-dark);color:var(--text-light);}

/* ---------- projects section ---------- */
.projects{
  position:relative;z-index:0;
  background-color:var(--bg-dark);color:var(--text-light);
}
.project-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:22px;}

/* ---------- about (tentang saya) ---------- */
.about{position:relative;z-index:0;padding-top:72px;padding-bottom:72px;background:var(--bg-dark);color:var(--text-light);}
.about-grid{
  max-width:1100px;margin:0 auto;
  display:grid;grid-template-columns:1fr 320px;gap:64px;align-items:stretch;
}
.about-left{display:flex;flex-direction:column;min-width:0;}
.about-left .section-head{margin-bottom:48px;}
@media(max-width:900px){.about-grid{grid-template-columns:1fr;}}

/* ---------- footer ---------- */
footer{
  position:relative;overflow:hidden;
  background:var(--bg-dark);color:var(--text-light);
  padding:56px 72px 0;text-align:center;
  scroll-margin-top:var(--scroll-offset);
}
footer .f-kanji{
  font-family:var(--font-brush);font-size:clamp(90px,12vw,150px);line-height:1;
  color:var(--shu);display:block;margin-bottom:6px;
  text-shadow:0 0 60px rgba(184,50,31,.25);
}
footer h2{font-family:var(--font-display);font-weight:800;font-size:clamp(26px,3vw,40px);margin-bottom:14px;color:var(--text-light);}
footer p{color:var(--text-dim);font-size:14.5px;max-width:520px;margin:0 auto 30px;}
footer .btn-ghost{margin-left:14px;}
.footer-social{display:flex;gap:24px;flex-wrap:wrap;align-items:center;justify-content:center;margin-top:34px;}
.footer-social .hero-social-link{color:var(--text-light);}
.footer-social .hero-social-link:hover{color:var(--shu-bright);}
/* ombak seigaiha nila di dasar footer, memudar ke atas */
footer .f-waves{
  height:120px;margin:56px -72px 0;
  background-image:var(--pat-seigaiha-footer);background-size:40px 20px;
  -webkit-mask-image:linear-gradient(transparent,#000 70%);
  mask-image:linear-gradient(transparent,#000 70%);
}
footer .f-line{
  position:absolute;left:0;right:0;bottom:0;padding:16px 20px 18px;
  font-family:var(--font-mono);font-size:11.5px;letter-spacing:.06em;color:var(--text-dim);
  background:linear-gradient(transparent,rgba(18,16,14,.9) 40%);
}

@media(max-width:1020px){
  .hero{grid-template-columns:1fr;text-align:center;padding:40px 22px;gap:44px;}
  .hero-vertical{display:none;}
  .hero-left{display:flex;flex-direction:column;align-items:center;}
  .hero-eyebrow::before{display:none;}
  .hero-right{align-items:center;}
  .stat{padding-left:0;text-align:center;padding-top:30px;}
  .stat::before{left:50%;transform:translateX(-50%);}
  .stat::after{display:none;}
}
@media(max-width:760px){
  footer{padding:48px 22px 0;}
  footer .f-waves{margin:48px -22px 0;}
  footer .btn-ghost{margin-left:0;margin-top:12px;}
}
