@font-face {
  font-family: "Vazirmatn";
  src: url("/fonts/vazirmatn-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Lalezar";
  src: url("/fonts/lalezar-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE80-FEFC;
  font-display: swap;
}
@font-face {
  font-family: "Lalezar";
  src: url("/fonts/lalezar-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  font-display: swap;
}

/* ================= themes =================
   Each theme is one main colour plus one accent, so the page reads as a single family. */
:root,
:root[data-theme="blue"] {
  --primary: #1F4FA3;
  --primary-deep: #17397A;
  --primary-soft: #E3EBF8;
  --primary-text: #1F4FA3;
  --accent: #FF8A3D;
  --bar: #FF8A3D;
  --btn-bg: #D94E08; --btn-fg: #fff; --btn-hover-bg: #FF8A3D; --btn-hover-fg: #1D2430;
  --pot-a: #F5F1E8; --pot-b: #FF8A3D; --pot-c: #8FB0E8; --pot-glaze: #1F4FA3;
  --pot-inside: #D94E08; --pot-rim: #D9D2C2; --pot-rim-soft: #FFB27A; --pot-line: #F5F1E8;
}
:root[data-theme="orange"] {
  --primary: #D94E08;
  --primary-deep: #A63A04;
  --primary-soft: #FDE9DD;
  --primary-text: #B53F05;
  --accent: #FFE3A3;
  --bar: #F5A400;
  --btn-bg: #1D2430; --btn-fg: #fff; --btn-hover-bg: #fff; --btn-hover-fg: #A63A04;
  --pot-a: #F5F1E8; --pot-b: #1D2430; --pot-c: #FFC49A; --pot-glaze: #D94E08;
  --pot-inside: #3A4358; --pot-rim: #D9D2C2; --pot-rim-soft: #4A5568; --pot-line: #F5F1E8;
}
:root[data-theme="green"] {
  --primary: #1E6B4F;
  --primary-deep: #14503A;
  --primary-soft: #DCEFE6;
  --primary-text: #1E6B4F;
  --accent: #FFC15E;
  --bar: #F5A400;
  --btn-bg: #FFC15E; --btn-fg: #1D2430; --btn-hover-bg: #fff; --btn-hover-fg: #14503A;
  --pot-a: #F5F1E8; --pot-b: #FFC15E; --pot-c: #7FD1AB; --pot-glaze: #1E6B4F;
  --pot-inside: #E39A1F; --pot-rim: #D9D2C2; --pot-rim-soft: #FFD98F; --pot-line: #14503A;
}

:root {
  --paper: #FBFBF9;
  --ink: #1D2430;
  --muted: #5A6372;
  --line: #DDE1E8;

  --font-body: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --font-display: "Lalezar", "Vazirmatn", system-ui, sans-serif;

  --gutter: clamp(1.25rem, 5vw, 4rem);
  --max: 1180px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { max-width: 100%; display: block; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

:focus-visible { outline: 3px solid var(--bar); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; inset-inline-start: 1rem; top: -4rem; z-index: 100;
  background: #fff; color: var(--ink); padding: .5rem 1rem; border-radius: 6px;
}
.skip:focus { top: 1rem; }

/* ---------- header: tabs on the right, brand on the left ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem var(--gutter);
  background: var(--primary);
  color: #fff;
  transition: box-shadow .3s, background-color .4s;
}
.top.scrolled { box-shadow: 0 8px 28px rgba(10, 20, 40, .28); }
.nav { order: 1; display: flex; gap: 1.75rem; font-weight: 500; font-size: .98rem; }
.brand {
  order: 2;
  font-family: var(--font-display);
  font-size: 1.6rem; line-height: 1.2;
  text-decoration: none; letter-spacing: .01em;
  direction: ltr;
  transition: transform .3s var(--ease-spring);
}
.brand:hover { transform: scale(1.06) rotate(-2deg); }
.nav a {
  text-decoration: none; padding: .25rem 0;
  background: linear-gradient(var(--accent), var(--accent)) no-repeat right bottom / 0 3px;
  transition: background-size .3s var(--ease-out);
}
.nav a:hover, .nav a[aria-current="true"] { background-size: 100% 3px; }
.menu-btn {
  order: 1;
  display: none; background: transparent; color: #fff;
  border: 1.5px solid rgba(255,255,255,.6); border-radius: 999px; padding: .2rem 1rem;
  transition: background-color .2s, color .2s;
}
.menu-btn:hover { background: #fff; color: var(--primary); }
.scroll-progress {
  position: absolute; inset-inline: 0; bottom: 0; height: 3px;
  background: var(--accent); transform-origin: right; transform: scaleX(var(--p, 0));
}

/* ---------- hero ---------- */
.hero {
  background: var(--primary);
  color: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: end;
  gap: 2rem;
  padding: clamp(2rem, 6vw, 5rem) var(--gutter) 0;
  overflow: hidden;
  transition: background-color .4s;
}
.hero-text { padding-bottom: clamp(2.5rem, 7vw, 6rem); align-self: center; }
.hero-role { font-weight: 600; font-size: 1.15rem; color: var(--accent); margin-bottom: .25rem; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.2rem, 9.5vw, 7.2rem);
  line-height: 1.12;
  text-wrap: balance;
}
.hero-tagline { font-size: clamp(1.1rem, 2.2vw, 1.45rem); margin-top: 1.25rem; max-width: 26ch; color: rgba(255,255,255,.88); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.btn {
  display: inline-block; text-decoration: none; font-weight: 700;
  padding: .7rem 1.6rem; border-radius: 999px; border: 2px solid transparent; line-height: 1.6;
  transition: background-color .2s, color .2s, border-color .2s, transform .25s var(--ease-spring), box-shadow .25s;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0,0,0,.22); }
.btn:active { transform: translateY(0) scale(.97); box-shadow: none; }
.btn-main { background: var(--btn-bg); color: var(--btn-fg); }
.btn-main:hover { background: var(--btn-hover-bg); color: var(--btn-hover-fg); }
.btn-line { border-color: rgba(255,255,255,.75); color: #fff; }
.btn-line:hover { background: #fff; color: var(--primary-text); }

.hero > * { max-width: none; margin-inline: 0; }
.hero-art { width: 100%; }
.hero-art svg { width: 100%; height: auto; max-height: 520px; margin-inline: auto; }
.shelf { fill: var(--primary-deep); }
.wheel-fill { fill: rgba(255,255,255,.09); }
.wheel-ring { fill: none; stroke: rgba(255,255,255,.35); stroke-width: 3; stroke-dasharray: 4 16; stroke-linecap: round; }
.pot-a { fill: var(--pot-a); }
.pot-b { fill: var(--pot-b); }
.pot-c { fill: var(--pot-c); }
.glaze { fill: var(--pot-glaze); }
.rim { fill: var(--pot-rim); }
.rim-soft { fill: var(--pot-rim-soft); }
.inside { fill: var(--pot-inside); }
.dots, .stripe { stroke: var(--pot-line); stroke-width: 6; stroke-linecap: round; fill: none; }

/* ---------- sections ---------- */
main { overflow-x: clip; }
section { padding: clamp(3rem, 8vw, 6rem) var(--gutter); }
section > * { max-width: var(--max); margin-inline: auto; }
h2 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.3; color: var(--primary-text);
  position: relative; padding-bottom: .55rem;
}
h2::after {
  content: ""; position: absolute; inset-inline-start: 0; bottom: 0;
  width: 3.5rem; height: 5px; border-radius: 3px; background: var(--bar);
  transition: width .9s var(--ease-out) .25s;
}
h3 { font-size: 1.1rem; font-weight: 700; line-height: 1.7; }

.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-bottom: 2rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.filters button {
  background: transparent; color: var(--ink); border: 1.5px solid var(--line);
  border-radius: 999px; padding: .15rem 1rem; font-size: .95rem; line-height: 1.8;
  transition: background-color .2s, border-color .2s, color .2s, transform .25s var(--ease-spring);
}
.filters button:hover { border-color: var(--primary); transform: translateY(-2px); }
.filters button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- works ---------- */
.grid { columns: 3 280px; column-gap: 1.25rem; }
.card { break-inside: avoid; margin-bottom: 1.5rem; }
.card button {
  display: block; width: 100%; padding: 0; border: 0; background: none; text-align: start; color: inherit;
  transition: transform .4s var(--ease-out);
}
.card button:hover, .card button:focus-visible { transform: translateY(-6px); }
.thumb {
  position: relative; overflow: hidden; background: var(--primary-soft);
  border-radius: 22px 22px 6px 6px;
  outline: 3px solid transparent; outline-offset: 3px;
  transition: outline-color .2s, box-shadow .4s, border-radius .4s var(--ease-out);
}
.card button:hover .thumb, .card button:focus-visible .thumb {
  outline-color: transparent; box-shadow: -12px 12px 0 var(--bar), 0 18px 34px rgba(20, 30, 50, .2);
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease-out); }
.card button:hover .thumb img, .card button:hover .thumb video,
.card button:focus-visible .thumb img { transform: scale(1.08); }
.thumb::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--primary-deep), transparent 55%);
  opacity: 0; transition: opacity .4s;
}
.card button:hover .thumb::after, .card button:focus-visible .thumb::after { opacity: .5; }
.thumb.is-video { aspect-ratio: 4 / 5; }
.view {
  position: absolute; z-index: 2; inset-inline: 0; bottom: 1rem; margin-inline: auto; width: fit-content;
  background: #fff; color: var(--primary-text); font-weight: 700; font-size: .9rem; line-height: 1; padding: .5rem 1.1rem; border-radius: 999px;
  opacity: 0; transform: translateY(14px) scale(.9);
  transition: opacity .35s, transform .45s var(--ease-spring);
}
.card button:hover .view, .card button:focus-visible .view { opacity: 1; transform: none; }
.badge {
  position: absolute; z-index: 2; inset-block-start: .75rem; inset-inline-start: .75rem;
  background: rgba(29,36,48,.82); color: #fff; font-size: .8rem; line-height: 1;
  border-radius: 999px; padding: .4rem .7rem;
}
.cap { padding: .6rem .25rem 0; }
.cap strong { display: block; font-weight: 700; line-height: 1.6; }
.cap span { color: var(--muted); font-size: .9rem; }

.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; border: 2px dashed var(--line); border-radius: 22px; }
.empty p:first-child { font-size: 1.2rem; color: var(--ink); font-weight: 600; }

/* ---------- about ---------- */
.about { background: var(--primary-soft); transition: background-color .4s; }
.about-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2.5rem; margin-top: 1.5rem; align-items: start; }
.about-text { font-size: clamp(1.15rem, 2vw, 1.4rem); line-height: 2.1; max-width: 38em; }
.about-facts { display: grid; gap: .9rem; }
.fact {
  padding: 1rem 1.25rem; border-radius: 6px 22px 6px 22px; background: #fff;
  border-inline-start: 6px solid var(--primary);
  transition: transform .35s var(--ease-spring), box-shadow .35s, border-color .4s;
}
.fact:hover { transform: translateX(-8px); box-shadow: 0 12px 26px rgba(20, 30, 50, .14); }
.fact strong { display: block; font-size: 1.1rem; color: var(--primary-text); }
.fact span { font-size: .95rem; color: var(--muted); line-height: 1.7; display: block; }

/* ---------- skills ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.5rem; }
.chips li {
  padding: .1rem 1.15rem; border-radius: 999px; font-weight: 600;
  color: var(--primary-text); background: var(--primary-soft); border: 2px solid var(--primary);
  cursor: default;
  transition: background-color .25s, color .25s, transform .3s var(--ease-spring);
}
.chips li:hover { background: var(--primary); color: #fff; transform: translateY(-4px) rotate(-2deg); }

/* ---------- experience ---------- */
.exp-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 3rem; margin-top: 1.5rem; }
.exp-layout h3 { color: var(--primary-text); font-size: 1.25rem; margin-bottom: 1rem; }
.timeline { border-inline-start: 3px solid var(--line); padding-inline-start: 1.5rem; display: grid; gap: 1.75rem; }
.job { position: relative; }
.job::before {
  content: ""; position: absolute; inset-inline-start: calc(-1.5rem - 8.5px); top: .65rem;
  width: 14px; height: 14px; border-radius: 50%; background: var(--paper); border: 3px solid var(--bar);
  transition: transform .3s var(--ease-spring), background-color .3s;
}
.job:hover::before { transform: scale(1.5); background: var(--bar); }
.job-head { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; }
.job-head h4 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.period { font-size: .85rem; color: var(--primary-text); background: var(--primary-soft); border-radius: 999px; padding: 0 .7rem; font-weight: 600; }
.job-place { color: var(--muted); font-size: .95rem; }
.job-desc { margin-top: .3rem; max-width: 60ch; }

.side { display: grid; gap: 2rem; align-content: start; }
.plain li { padding: .5rem 0; border-bottom: 1px solid var(--line); line-height: 1.7; }
.plain li:last-child { border-bottom: 0; }
.plain b { display: block; font-weight: 700; }
.plain small { color: var(--muted); font-size: .92rem; }

/* ---------- contact ---------- */
.contact { background: var(--primary-deep); color: #fff; transition: background-color .4s; }
.contact h2 { color: #fff; }
.contact h2::after { background: var(--accent); }
.contact-lead { margin-top: .5rem; font-size: 1.2rem; color: rgba(255,255,255,.85); }
.contact-list { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.contact-list > li { flex: 1 1 auto; min-width: 0; }
/* sized by their text: the e-mail address gets the room it needs and nothing wraps */
.contact-list .txt strong { white-space: nowrap; }
@media (max-width: 520px) {
  .contact-list > li { flex-basis: 100%; }
  .contact-item { padding: .9rem; gap: .8rem; }
  .contact-item .ico { width: 2.75rem; height: 2.75rem; }
  .txt strong { font-size: .98rem; }
}
.contact-item {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border-radius: 20px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2);
  color: #fff; text-decoration: none; min-width: 0;
  transition: transform .35s var(--ease-spring), background-color .25s, box-shadow .3s;
}
a.contact-item:hover, a.contact-item:focus-visible { transform: translateY(-6px); background: rgba(255,255,255,.16); box-shadow: 0 16px 30px rgba(0,0,0,.28); }
.ico {
  flex: none; width: 3.25rem; height: 3.25rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #1D2430;
}
.ico svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
a.contact-item:hover .ico, a.contact-item:focus-visible .ico { animation: wiggle .6s var(--ease-out); }
.txt { display: grid; min-width: 0; line-height: 1.6; }
.txt small { color: rgba(255,255,255,.75); font-size: .88rem; }
.txt strong { font-size: 1.1rem; overflow-wrap: anywhere; }
.ltr { direction: ltr; unicode-bidi: isolate; text-align: start; }

.foot {
  display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem var(--gutter);
  background: var(--ink); color: #B8C0CE; font-size: .95rem;
}
.foot-brand { font-family: var(--font-display); font-size: 1.2rem; color: #fff; direction: ltr; }

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 200; background: rgba(12,20,38,.98); color: #fff;
  display: flex; flex-direction: column; padding: 3.5rem 1rem 1rem; overflow-y: auto;
}
.lb[hidden] { display: none; }
.lb-close {
  position: fixed; top: .9rem; inset-inline-end: 1rem; z-index: 2;
  background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 999px; padding: .25rem 1.1rem;
  transition: background-color .2s, transform .25s var(--ease-spring);
}
.lb-close:hover { background: var(--primary); transform: scale(1.08); }
.lb-stage { display: flex; align-items: center; justify-content: center; gap: .5rem; flex: 1 1 auto; min-height: 0; }
.lb-media { flex: 1 1 auto; display: flex; justify-content: center; align-items: center; min-width: 0; }
.lb-media img, .lb-media video { max-height: 68vh; max-width: 100%; width: auto; height: auto; border-radius: 10px; background: #000; }
.lb-nav {
  flex: none; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.14); color: #fff; font-size: 1.8rem; line-height: 1; padding-bottom: .2rem;
  transition: background-color .2s, transform .25s var(--ease-spring);
}
.lb-nav:hover { background: var(--primary); transform: scale(1.15); }
.lb-nav[hidden] { display: none; }
.lb-thumbs { display: flex; justify-content: center; gap: .5rem; margin-top: .9rem; flex-wrap: wrap; }
.lb-thumbs button {
  width: 56px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 8px;
  overflow: hidden; background: #222; opacity: .65; position: relative;
  transition: opacity .2s, transform .25s var(--ease-spring);
}
.lb-thumbs button:hover { opacity: 1; transform: translateY(-3px); }
.lb-thumbs button[aria-current="true"] { border-color: var(--accent); opacity: 1; }
.lb-thumbs img, .lb-thumbs video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.lb-info { max-width: 46rem; margin: 1rem auto 0; text-align: center; }
.lb-info h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.8rem; }
.lb-cat { color: var(--accent); font-weight: 600; font-size: .95rem; }
.lb-desc { white-space: pre-line; color: #D5DCE8; margin-top: .4rem; }
body.lb-open { overflow: hidden; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 2rem; }
  .hero-text { padding-bottom: 1rem; }
  .hero-art { order: 2; max-width: 460px; margin-inline: auto; width: 100%; }
  .about-body, .exp-layout { grid-template-columns: 1fr; }
  .menu-btn { display: inline-block; }
  .nav {
    display: none; position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; gap: 0; background: var(--primary-deep); padding: .5rem var(--gutter) 1rem;
  }
  .nav.open { display: flex; animation: drop .3s var(--ease-out); }
  .nav a { padding: .6rem 0; border-bottom: 1px solid rgba(255,255,255,.15); background-image: none; }
  .grid { columns: 2 160px; column-gap: .9rem; }
  .lb-nav { width: 2.25rem; height: 2.25rem; }
}
@media (max-width: 480px) {
  .grid { columns: 1; }
  .cap strong { font-size: 1rem; }
}

/* ================= art direction layer =================
   One idea runs through the page: glaze. Colour blocks end in dripping glaze,
   surfaces carry clay grain and speckles, shapes are hand-thrown rather than ruled. */
body { background: var(--paper) url("/img/speckle-dark.svg") 0 0 / 360px; }

/* glaze drips between colour blocks */
.drip { height: clamp(46px, 6.2vw, 94px); background: var(--drip-bg, transparent); line-height: 0; overflow: hidden; }
.drip svg { width: 100%; height: 100%; display: block; fill: var(--drip-fill); transform-origin: top; transition: fill .4s; }
.drip-hero { --drip-fill: var(--primary); }
.drip-to-about { --drip-bg: var(--primary-soft); --drip-fill: var(--paper); }
.drip-from-about { --drip-fill: var(--primary-soft); }
.drip-to-contact { --drip-bg: var(--primary-deep); --drip-fill: var(--paper); }
.drip-to-contact { background-color: var(--primary-deep); background-image: url("/img/grain.svg"), url("/img/speckle-light.svg"); background-size: 240px, 360px; transition: background-color .4s; }
.about { padding-top: clamp(1.5rem, 4vw, 3rem); background-image: url("/img/speckle-dark.svg"); background-size: 360px; }
.contact { padding-top: clamp(1.5rem, 4vw, 3rem); }

/* hero: clay grain, speckles, hand-thrown blobs */
.hero {
  position: relative; isolation: isolate;
  background-image: url("/img/grain.svg"), url("/img/speckle-light.svg");
  background-size: 240px, 360px;
}
.hero > * { position: relative; z-index: 1; }
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; pointer-events: none; -webkit-mask: url("/img/blob.svg") center / contain no-repeat; mask: url("/img/blob.svg") center / contain no-repeat; }
.hero::before { width: min(680px, 90vw); aspect-ratio: 1; inset-inline-start: -9%; bottom: -26%; background: rgba(255,255,255,.1); }
.hero::after { width: min(360px, 55vw); aspect-ratio: 1; inset-inline-end: -5%; top: -16%; background: rgba(255,255,255,.07); }
.hero h1 { text-shadow: 4px 5px 0 var(--primary-deep); }
.hero-role {
  display: inline-block; position: relative; isolation: isolate; color: var(--ink);
  padding: .1rem 1.4rem .2rem; margin-bottom: .7rem; font-weight: 800;
}
.hero-role::before {
  content: ""; position: absolute; inset: -3px -8px; z-index: -1; background: var(--accent);
  -webkit-mask: url("/img/brush.svg") center / 100% 100% no-repeat; mask: url("/img/brush.svg") center / 100% 100% no-repeat;
}
.speck circle { fill: rgba(70, 45, 30, .4); }

/* maker's seal */
.hero-art { position: relative; }
.seal { position: absolute; z-index: 2; top: 3%; right: 2%; width: clamp(92px, 12vw, 144px); aspect-ratio: 1; direction: ltr; }
.seal > svg:first-child { width: 100%; height: 100%; }
.seal-disc { fill: var(--accent); transition: fill .4s; }
.seal-text { font-family: var(--font-display); font-size: 17px; fill: var(--ink); direction: ltr; }
.seal-core { position: absolute; inset: 0; width: 34%; height: 34%; margin: auto; fill: none; stroke: var(--ink); stroke-width: 3; }

/* ribbon of skills */
.marquee {
  position: relative; z-index: 3; overflow: hidden; background: var(--accent); color: var(--ink);
  transform: rotate(-1.3deg) scale(1.04); margin: .6rem 0 1rem; padding: .35rem 0;
  transition: background-color .4s;
}
.marquee[hidden] { display: none; }
/* the ribbon is laid out left-to-right so the loop always starts at the left edge, even on this right-to-left page */
.marquee { direction: ltr; }
.marquee-track { display: flex; width: max-content; direction: ltr; font-family: var(--font-display); font-size: clamp(1.25rem, 2.6vw, 1.7rem); line-height: 1.7; }
.marquee-track span { display: flex; align-items: center; gap: 2.2rem; padding-inline-end: 2.2rem; white-space: nowrap; }
.marquee-track span::after { content: ""; width: .85rem; height: .85rem; border-radius: 50%; border: 3px solid currentColor; }

/* headings get a hand-drawn squiggle instead of a ruled bar */
h2::after {
  height: 12px; width: 6.5rem; border-radius: 0;
  -webkit-mask: url("/img/squiggle.svg") 0 center / 40px 12px repeat-x; mask: url("/img/squiggle.svg") 0 center / 40px 12px repeat-x;
}

/* works: arch, soft and petal frames with a hard glaze-coloured offset */
.thumb { border-radius: 50% 50% 16px 16px / 22% 22% 16px 16px; box-shadow: -9px 9px 0 var(--primary-soft); }
.card:nth-child(3n+2) .thumb { border-radius: 30px; box-shadow: -9px 9px 0 var(--accent); }
.card:nth-child(3n) .thumb { border-radius: 76px 14px 76px 14px; box-shadow: -9px 9px 0 var(--primary-soft); }
.card button {
  transform: perspective(900px) translateY(0) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .3s var(--ease-out);
}
.card button:hover, .card button:focus-visible {
  transform: perspective(900px) translateY(-6px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
.cap { padding: .9rem .4rem 0; }
.cap strong { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; line-height: 1.5; color: var(--ink); }
.cap span { display: inline-block; margin-top: .15rem; padding: 0 .75rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary-text); font-size: .82rem; font-weight: 600; }

/* about: stickers on a glaze blob */
.about-facts { position: relative; isolation: isolate; padding: 1rem .5rem; }
.about-facts::before {
  content: ""; position: absolute; inset: -12% -14%; z-index: -1; background: var(--primary); opacity: .13; pointer-events: none;
  -webkit-mask: url("/img/blob.svg") center / contain no-repeat; mask: url("/img/blob.svg") center / contain no-repeat;
}
.fact { border: 2px solid var(--primary); border-radius: 24px 6px 24px 6px; box-shadow: -6px 6px 0 var(--primary); rotate: var(--r, 0deg); }
.fact:nth-child(1) { --r: -1.4deg; }
.fact:nth-child(2) { --r: 1deg; }
.fact:nth-child(3) { --r: -.7deg; }
.fact:hover { box-shadow: -10px 10px 0 var(--bar); }

/* skills: pebbles */
.chips { gap: .8rem .7rem; }
.chips li { border: 0; padding: .3rem 1.5rem; font-size: 1.05rem; rotate: var(--r, 0deg); border-radius: 58% 42% 52% 48% / 55% 58% 42% 45%; }
.chips li:nth-child(4n+2) { border-radius: 42% 58% 44% 56% / 58% 42% 58% 42%; }
.chips li:nth-child(4n+3) { border-radius: 52% 48% 60% 40% / 44% 60% 40% 56%; }
.chips li:nth-child(4n) { border-radius: 46% 54% 40% 60% / 60% 44% 56% 40%; }
.chips li:nth-child(5n+1) { --r: -2.2deg; }
.chips li:nth-child(5n+2) { --r: 1.6deg; }
.chips li:nth-child(5n+3) { --r: -.8deg; }
.chips li:nth-child(5n+4) { --r: 2.2deg; }
.chips li:nth-child(3n+2) { background: var(--accent); color: var(--ink); }
.chips li:nth-child(3n) { background: var(--primary); color: #fff; }
.chips li:hover { background: var(--ink); color: #fff; }

/* contact: grain, speckles, glaze blob */
.contact { position: relative; isolation: isolate; overflow: hidden; background-image: url("/img/grain.svg"), url("/img/speckle-light.svg"); background-size: 240px, 360px; }
.contact::before {
  content: ""; position: absolute; z-index: -1; width: min(520px, 80vw); aspect-ratio: 1; inset-inline-start: -8%; bottom: -34%;
  background: var(--accent); opacity: .13; pointer-events: none;
  -webkit-mask: url("/img/blob.svg") center / contain no-repeat; mask: url("/img/blob.svg") center / contain no-repeat;
}

@media (max-width: 860px) {
  .seal { top: 0; right: 0; }
  .hero::before { bottom: -12%; }
}
@media (max-width: 480px) {
  .thumb { border-radius: 50% 50% 16px 16px / 14% 14% 16px 16px; }
}

/* works as a single scrolling row once there are more than six */
.rail-nav { display: flex; gap: .5rem; margin-inline-start: auto; }
.rail-nav[hidden] { display: none; }
.rail-nav button {
  width: 2.9rem; height: 2.9rem; border-radius: 50%; border: 0; padding: 0 0 .25rem;
  background: var(--primary); color: #fff; font-size: 1.9rem; line-height: 1;
  transition: background-color .2s, color .2s, transform .25s var(--ease-spring), opacity .2s;
}
.rail-nav button:hover:not(:disabled) { background: var(--bar); color: var(--ink); transform: scale(1.1); }
.rail-nav button:disabled { opacity: .3; cursor: default; }

.grid.rail {
  columns: auto; display: flex; align-items: flex-start; gap: 1.5rem;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scroll-padding-inline: 1rem; scrollbar-width: thin; scrollbar-color: var(--primary) transparent;
  /* room around the cards for the offset shadow and the hover lift (overflow clips both axes) */
  padding: 1.25rem 1rem 1.75rem; cursor: grab;
}
.grid.rail.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.grid.rail .card { flex: 0 0 clamp(236px, 25vw, 300px); margin: 0; scroll-snap-align: start; }
.grid.rail .thumb { aspect-ratio: 4 / 5; }
.grid.rail::-webkit-scrollbar { height: 8px; }
.grid.rail::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 999px; }
.grid.rail::-webkit-scrollbar-track { background: var(--primary-soft); border-radius: 999px; }
@media (max-width: 480px) { .grid.rail .card { flex-basis: 74vw; } }

/* ================= motion =================
   Everything below only runs when the visitor has not asked for reduced motion. */
@keyframes rise { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: none; } }
@keyframes throw { from { transform: scaleY(.12) scaleX(1.14); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bob { from { translate: 0 0; } to { translate: 0 -9px; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wiggle { 0% { transform: rotate(0) scale(1); } 30% { transform: rotate(-14deg) scale(1.18); } 60% { transform: rotate(10deg) scale(1.1); } 100% { transform: rotate(0) scale(1); } }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  /* hero: text rises in sequence, the pieces are "thrown" up from the shelf, then drift gently */
  .hero-role, .hero h1, .hero-tagline, .hero-actions { animation: rise .9s var(--ease-out) both; }
  .hero-role { animation-delay: .05s; }
  .hero h1 { animation-delay: .18s; }
  .hero-tagline { animation-delay: .34s; }
  .hero-actions { animation-delay: .5s; }

  .pot { transform-box: fill-box; transform-origin: 50% 100%; animation: throw .9s var(--ease-out) both, bob 5s ease-in-out 1.4s infinite alternate; }
  .pot-2 { animation-delay: .2s, 1.8s; animation-duration: .9s, 6s; }
  .pot-3 { animation-delay: .4s, 2.2s; animation-duration: .9s, 5.5s; }
  .wheel-ring { transform-box: fill-box; transform-origin: center; animation: spin 60s linear infinite; }
  .wheel-fill { animation: fade 1.6s .2s both; }

  /* scroll reveals: classes are added by site.js */
  .reveal { opacity: 0; transform: translateY(30px); }
  .reveal.in { opacity: 1; transform: none; transition: opacity .8s ease var(--d, 0ms), transform .8s var(--ease-out) var(--d, 0ms); }
  .reveal-card { transform: translateY(40px) scale(.94); }
  .reveal-chip { transform: scale(.6); }
  .reveal-chip.in { transition: opacity .5s ease var(--d, 0ms), transform .6s var(--ease-spring) var(--d, 0ms); }
  .reveal-side { transform: translateX(46px); }
  .reveal-left { transform: translateX(-46px); }
  .reveal-head:not(.in)::after { width: 0; }

  .lb:not([hidden]) { animation: fade .3s ease; }
  .lb-media > * { animation: pop .35s var(--ease-out); }
  .lb-info { animation: rise .5s var(--ease-out) .1s both; }
}
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: no-preference) {
  .seal > svg:first-child { animation: spin 24s linear infinite; }
  .hero::before { animation: spin 140s linear infinite; }
  .hero::after { animation: spin 90s linear infinite reverse; }
  .marquee-track { animation: marquee 50s linear infinite; }
  .marquee:hover .marquee-track { animation-play-state: paused; }
  /* glaze runs down once when a drip edge scrolls into view */
  .reveal-drip { opacity: 1; transform-origin: top; transform: scaleY(.1); }
  .reveal-drip.in { transition: transform 1.1s var(--ease-spring) var(--d, 0ms); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
