/* rakithaperera.com · hand-built static site */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Kolombo";
  src: url("/s/Kolombo-No2.otf") format("opentype");
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-alt: #f4f4f5;
  --card: #ffffff;
  --fg: #111111;
  --muted: #6b7080;
  --subtle: #a1a4ad;
  --line: #ebebee;
  --line-strong: #dcdce0;
  --accent: #111111;
  --radius: 6px;
  --pad: clamp(16px, 2.4vw, 40px);
  --maxw: 1520px;
  --header-h: 68px;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0f;
    --bg-alt: #151518;
    --card: #121215;
    --fg: #f1f1f3;
    --muted: #9b9ea8;
    --subtle: #6c6f79;
    --line: #232328;
    --line-strong: #2f2f35;
    --accent: #f1f1f3;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
ul { margin: 0; padding: 0; }
strong { font-weight: 600; }
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: var(--pad); top: -60px; z-index: 100;
  background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: var(--radius);
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: var(--header-h);
}
.brand { display: flex; flex-direction: column; line-height: 1.25; padding: 10px 0; }
.brand-name { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.brand-meta { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav { display: flex; gap: 22px; align-items: center; }
.nav a {
  font-size: 15px; color: var(--muted);
  transition: color .2s var(--ease);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
.nav .ext::after { content: "↗"; font-size: 11px; margin-left: 2px; vertical-align: 2px; }
.menu-btn {
  display: none; appearance: none; border: 1px solid var(--line-strong); background: transparent;
  color: var(--fg); font: 500 14px/1 var(--sans); padding: 9px 14px; border-radius: 999px; cursor: pointer;
}
@media (max-width: 880px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  body.menu-open { overflow: hidden; }
  body.menu-open .nav {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 49;
    background: var(--bg); padding: 32px var(--pad);
    height: calc(100dvh - var(--header-h));
  }
  body.menu-open .nav a { font-size: 34px; letter-spacing: -0.03em; color: var(--fg); padding: 4px 0; }
  body.menu-open .nav a:not([aria-current="page"]) { color: var(--muted); }
}

/* ---------- type ---------- */
.display {
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 400;
  text-wrap: balance;
}
.display-light { font-weight: 300; }
.lead { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.6; color: var(--muted); max-width: 40ch; }
.kicker { font-size: 15px; color: var(--muted); margin-bottom: 18px; display: block; }
.label { font-size: 24px; letter-spacing: -0.02em; line-height: 1.3; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; color: var(--subtle); }
.muted { color: var(--muted); }
.prose { color: var(--muted); font-size: 18px; line-height: 1.72; max-width: 62ch; overflow-wrap: anywhere; }
.prose strong { color: var(--fg); font-weight: 500; }
.prose a, .link {
  color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-strong);
  text-underline-offset: 4px; text-decoration-thickness: 1px;
  transition: text-decoration-color .2s var(--ease);
}
.prose a:hover, .link:hover { text-decoration-color: currentColor; }
.prose h2 { color: var(--fg); font-size: 26px; letter-spacing: -0.025em; margin: 2.2em 0 .6em; line-height: 1.25; }
.prose h3 { color: var(--fg); font-size: 19px; font-weight: 500; letter-spacing: -0.01em; margin: 1.8em 0 .5em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul { padding-left: 1.1em; margin: 0 0 1em; }
.prose li { margin: .25em 0; }
.prose li::marker { color: var(--subtle); }

/* ---------- buttons ---------- */
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 15px/1 var(--sans); padding: 13px 18px; border-radius: 999px;
  border: 1px solid var(--fg); background: var(--fg); color: var(--bg);
  transition: transform .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--fg); }
.btn[aria-disabled="true"] { background: transparent; color: var(--subtle); border-color: var(--line-strong); cursor: default; transform: none; }
.btn .arr { transition: transform .2s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }

/* ---------- sections ---------- */
.section { padding: clamp(56px, 7vw, 104px) 0; border-top: 1px solid var(--line); }
.section.first { border-top: 0; }
.row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 20px; }
.row > .row-label { grid-column: 1 / span 5; }
.row > .row-body { grid-column: 7 / -1; }
@media (max-width: 880px) {
  .row > .row-label, .row > .row-body { grid-column: 1 / -1; }
}
.section-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 12px; margin-bottom: 40px; align-items: end; }
.section-head .label { grid-column: 1 / span 5; }
.section-head .aside { grid-column: 7 / -1; color: var(--muted); max-width: 52ch; }
@media (max-width: 880px) { .section-head .label, .section-head .aside { grid-column: 1 / -1; } }

/* ---------- page hero (inner pages) ---------- */
.page-hero { padding: clamp(56px, 9vw, 140px) 0 clamp(40px, 5vw, 72px); }
.page-hero .display { max-width: 16ch; }
.page-hero .lead { margin-top: 24px; }

/* ---------- home hero ---------- */
.hero { padding: clamp(28px, 3vw, 40px) 0 clamp(56px, 7vw, 96px); }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 64px); align-items: center; min-height: min(78vh, 820px); }
.hero-copy .display { max-width: 13ch; }
.hero-copy .lead { margin-top: 28px; }
.hero-media { position: relative; }
.slides {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: var(--bg-alt);
}
.slides img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.04);
  transition: opacity 1.4s var(--ease), transform 7s linear;
}
.slides img.on { opacity: 1; transform: scale(1); }
.slides-meta { display: flex; justify-content: space-between; margin-top: 12px; }
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .slides { aspect-ratio: 4 / 3; }
}

/* headline word reveal */
.js .split .w { display: inline-block; opacity: 0; filter: blur(10px); transform: translateY(.18em); transition: opacity .9s var(--ease), filter .9s var(--ease), transform .9s var(--ease); }
.js .split.is-in .w { opacity: 1; filter: blur(0); transform: none; }

/* scroll reveal */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .split .w, .js [data-reveal] { opacity: 1; filter: none; transform: none; transition: none; }
  .slides img { transition: opacity .4s linear; transform: none !important; }
}

/* ---------- services ---------- */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }
.card {
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); padding: 18px 20px 24px; min-height: 380px;
  transition: border-color .3s var(--ease);
}
.card:hover { border-color: var(--line-strong); }
.card .icon { width: 72px; height: 72px; margin: 36px 0 auto; color: var(--fg); }
.card .icon svg { width: 100%; height: 100%; }
.card h3 { font-size: 26px; letter-spacing: -0.03em; margin-top: 40px; }
.card .tag { font-size: 15px; font-weight: 500; margin: 6px 0 10px; }
.card p { font-size: 15px; color: var(--muted); line-height: 1.55; }

/* ---------- featured work ---------- */
.feature-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 12px; }
.feature-grid > :nth-child(4n+3) { grid-column: auto; }
.feature-grid.alt { grid-template-columns: 5fr 7fr; margin-top: 12px; }
@media (max-width: 720px) { .feature-grid, .feature-grid.alt { grid-template-columns: 1fr; } }
.tile { display: block; }
.tile .frame { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); height: clamp(320px, 40vw, 660px); }
@media (max-width: 720px) { .tile .frame { height: auto; aspect-ratio: 4 / 3; } }
.tile .frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.tile:hover .frame img { transform: scale(1.035); }
.tile .cap { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 15px; }
.tile .cap span:last-child { color: var(--subtle); font-size: 14px; }

/* ---------- logos marquee ---------- */
.marquee {
  overflow: hidden; padding: 36px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 42s linear infinite; }
.marquee-track img { height: clamp(34px, 3.6vw, 52px); width: auto; max-width: none; margin-right: 80px; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { .marquee-track img, .logos img { filter: invert(1); mix-blend-mode: screen; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }
.logos img { mix-blend-mode: multiply; width: 100%; }

/* ---------- list rows (recognition, downloads, weeks) ---------- */
.list { border-top: 1px solid var(--line); }
.list-item { display: grid; grid-template-columns: 120px 1fr auto; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.list-item .t { font-size: 18px; letter-spacing: -0.01em; }
.list-item .d { color: var(--muted); font-size: 15px; margin-top: 2px; }
.list-item a.t:hover { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 560px) { .list-item { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- footer ---------- */
.cta { background: var(--bg-alt); padding: clamp(80px, 11vw, 160px) 0 clamp(40px, 5vw, 64px); margin-top: clamp(40px, 6vw, 80px); }
.cta .display { max-width: 15ch; }
.cta-mail {
  display: inline-block; margin-top: 18px; font-size: clamp(28px, 4.2vw, 60px); letter-spacing: -0.04em; font-weight: 300;
  color: var(--subtle); line-height: 1.1; transition: color .25s var(--ease); word-break: break-word;
}
.cta-mail:hover { color: var(--fg); }
.social { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 36px; font-size: 15px; }
.social a { color: var(--muted); }
.social a:hover { color: var(--fg); }
.social a::after { content: " ↗"; font-size: 12px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: clamp(72px, 9vw, 140px); padding-top: 20px; border-top: 1px solid var(--line-strong); font-size: 14px; color: var(--muted); }
.foot a:hover { color: var(--fg); }
.foot-plain { background: var(--bg-alt); padding: 0 0 40px; margin-top: 0; }
.foot-plain .foot { margin-top: 0; }

/* ---------- portfolio masonry ---------- */
.masonry { columns: 3 320px; column-gap: 12px; }
.m-item { break-inside: avoid; margin: 0 0 12px; }
.m-btn {
  display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; cursor: zoom-in; text-align: left; font: inherit;
}
.m-btn .frame { display: block; position: relative; border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); }
.m-btn img { width: 100%; transition: transform 1.1s var(--ease), opacity .4s; }
.m-btn:hover img { transform: scale(1.03); }
.m-cap { display: block; margin-top: 8px; font-size: 14px; line-height: 1.4; }
.m-cap small { display: block; color: var(--subtle); font-size: 13px; margin-top: 2px; }
.play {
  position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.92); color: #111; font: 500 13px/1 var(--sans); padding: 8px 12px 8px 10px; border-radius: 999px;
}
.play::before { content: ""; width: 0; height: 0; border-left: 8px solid #111; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.m-btn.video { cursor: pointer; }

/* ---------- lightbox ---------- */
.lb {
  border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh;
  background: color-mix(in srgb, var(--bg) 96%, transparent); color: var(--fg);
}
.lb::backdrop { background: rgba(0,0,0,.35); }
.lb[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 16px var(--pad); }
.lb-stage { position: relative; display: grid; place-items: center; padding: 0 var(--pad); min-height: 0; }
.lb-stage img { max-width: 100%; max-height: calc(100dvh - 170px); width: auto; height: auto; border-radius: var(--radius); object-fit: contain; }
.lb-stage .vid { width: min(100%, calc((100dvh - 170px) * 16 / 9)); aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.lb-stage iframe { width: 100%; height: 100%; border: 0; }
.lb-cap { padding: 14px var(--pad) 22px; min-height: 64px; max-width: 80ch; }
.lb-cap b { font-weight: 500; }
.lb-cap span { color: var(--muted); }
.lb-btn {
  appearance: none; border: 1px solid var(--line-strong); background: var(--bg); color: var(--fg);
  font: 500 14px/1 var(--sans); padding: 10px 14px; border-radius: 999px; cursor: pointer;
}
.lb-btn:hover { border-color: var(--fg); }
.lb-nav { display: flex; gap: 8px; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(24px, 5vw, 80px); align-items: start; }
.about-photo { position: sticky; top: calc(var(--header-h) + 24px); border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); aspect-ratio: 4 / 5; }
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 880px) { .about-grid { grid-template-columns: 1fr; } .about-photo { position: relative; top: 0; max-width: 520px; } }

/* ---------- classes ---------- */
.class { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(20px, 4vw, 64px); padding: clamp(32px, 4vw, 56px) 0; border-top: 1px solid var(--line); align-items: start; }
.class .frame { border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--subtle); }
.class .frame img { width: 100%; height: 100%; object-fit: cover; }
.class .frame svg { width: 72px; height: 72px; }
.class h2 { font-size: clamp(26px, 2.4vw, 34px); letter-spacing: -0.03em; line-height: 1.15; margin: 10px 0 4px; }
.class .org { color: var(--muted); margin-bottom: 16px; }
.class p.desc { color: var(--muted); max-width: 58ch; }
@media (max-width: 760px) { .class { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; font-size: 14px; color: var(--muted); }

/* ---------- downloads ---------- */
.dl { display: grid; grid-template-columns: 5fr 7fr; gap: 24px; padding: clamp(36px, 5vw, 64px) 0; border-top: 1px solid var(--line); }
.dl .specimen { font-size: clamp(40px, 5vw, 72px); letter-spacing: -0.02em; line-height: 1.05; }
.dl .specimen.kolombo { font-family: "Kolombo", var(--sans); letter-spacing: 0; }
.dl .meta { margin-top: 12px; }
@media (max-width: 760px) { .dl { grid-template-columns: 1fr; } }

/* ---------- tikiri ---------- */
.wide-media { border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); aspect-ratio: 3 / 2; }
.wide-media img { width: 100%; height: 100%; object-fit: cover; }
.feature-list { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.feature-list li { padding: 14px 0; border-bottom: 1px solid var(--line); display: flex; gap: 16px; color: var(--fg); }
.feature-list li .mono { padding-top: 4px; }
.note { font-style: italic; color: var(--muted); font-size: 15px; }

/* FAQ */
.faq { border-top: 1px solid var(--line); margin: 8px 0 32px; max-width: 62ch; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 20px;
  padding: 18px 0; font-size: 18px; color: var(--fg); letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 300; font-size: 22px; line-height: 1; color: var(--muted); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .a { padding: 0 0 20px; color: var(--muted); }

.narrow { max-width: 760px; }
.back { display: inline-flex; gap: 6px; color: var(--muted); font-size: 15px; margin-bottom: 28px; }
.back:hover { color: var(--fg); }
@media (max-width: 560px) {
  .card { min-height: 0; }
  .card .icon { width: 56px; height: 56px; margin: 24px 0 0; }
  .card h3 { margin-top: 28px; }
}
