/* Tamim — toy-desk portfolio. Coral ground, white boards, solid wide caps × coral Bodoni italic, 3D clay stickers. */
@font-face { font-family: "Unbounded Static"; src: url("../fonts/unbounded-800.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Caveat Static"; src: url("../fonts/caveat-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --red: #e4574b;
  --red-deep: #c8463b;
  --paper: #fffdf9;
  --paper-2: #f5f3ef;
  --ink: #1f1d1c;
  --ink-2: #4d4741;
  --line: rgba(31, 29, 28, 0.14);
  --yellow: #edb021;
  --sun: #f6c944;
  --orange-a: #f3b23f;
  --orange-b: #e8604a;
  --lime: #9bdb2e;
  --f-wide: "Unbounded Static", "Unbounded", "Arial Black", sans-serif;
  --f-serif: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --f-body: "Manrope", "Segoe UI", Arial, sans-serif;
  --f-ar: "Aref Ruqaa", "Amiri", serif;
  --gutter: clamp(12px, 2vw, 24px);
  --pad: clamp(20px, 4.2vw, 64px);
  --r-board: clamp(22px, 2.6vw, 36px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-lift: 0 18px 40px -18px rgba(60, 14, 8, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--red);
  color: var(--ink);
  font: 500 1rem/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased;
  padding: calc(var(--gutter) + 72px) var(--gutter) var(--gutter);
  overflow-x: hidden;
}
/* printed-paper grain on the red ground */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../img/grain.png");
  opacity: 0.09;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- type devices ---------- */
.solid {
  font-family: var(--f-wide);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--ink);
}
em {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--red-deep);
}

/* ---------- nav pill ---------- */
.nav {
  position: fixed;
  top: calc(var(--gutter) + 4px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: #232120;
  border-radius: 999px;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.5);
  max-width: calc(100vw - 2 * var(--gutter));
}
.nav-mark {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  background: var(--paper); color: var(--ink);
  border-radius: 50%;
  text-decoration: none;
  font: 800 1.15rem/1 var(--f-wide);
}
.nav-mark span { transform: translateY(-1px); }
.nav-links { display: flex; gap: 2px; }
.nav-links a, .nav-cta {
  text-decoration: none;
  font: 600 0.86rem/1 var(--f-body);
  padding: 14px 16px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.nav-links a { color: #e9e4de; border: 1px solid rgba(255, 255, 255, 0.12); }
.nav-links a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav-cta { background: var(--paper); color: var(--ink); }
.nav-cta:hover { background: var(--sun); }

/* ---------- boards ---------- */
main { position: relative; z-index: 1; }
.board {
  position: relative;
  max-width: 1400px;
  margin: 0 auto var(--gutter);
  background: var(--paper);
  border-radius: var(--r-board);
  overflow: hidden;
  isolation: isolate;
}

/* one authored motion: boards unwrap as they arrive */
.js .board { clip-path: inset(6% 4% 0 4% round var(--r-board)); transform: translateY(40px); opacity: 0.001; }
.js .board.in {
  clip-path: inset(0 0 0 0 round var(--r-board));
  transform: none;
  opacity: 1;
  transition: clip-path 1.1s var(--ease-out), transform 1.1s var(--ease-out), opacity 0.5s linear;
}
.js .board--hero { clip-path: none; transform: none; opacity: 1; }

/* ---------- scenes (live Three.js) ---------- */
.scene { position: relative; aspect-ratio: 3 / 2; background: #e9e1d6; overflow: hidden; }
.scene-fallback, .scene-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-fallback { object-fit: cover; transition: opacity 0.9s var(--ease-out); }
.scene-canvas { opacity: 0; transition: opacity 0.9s var(--ease-out); touch-action: pan-y; }
.scene.is-live .scene-canvas { opacity: 1; }
.scene.is-live .scene-fallback { opacity: 0; }
.scene-hint {
  position: absolute; left: 50%; bottom: 16px; translate: -50% 0;
  font: 700 0.8rem/1 var(--f-body);
  color: var(--ink); background: rgba(255, 253, 249, 0.86);
  padding: 9px 14px; border-radius: 999px; white-space: nowrap;
  opacity: 0; transition: opacity 0.6s var(--ease-out) 0.8s;
  pointer-events: none;
}
.scene.is-live .scene-hint { opacity: 1; }
.scene--contact .scene-hint { bottom: auto; top: 16px; }

/* ---------- 1 hero ---------- */
.board--hero .scene { max-height: calc(100svh - 2 * var(--gutter) - 72px); width: 100%; }
.hero-strip {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(20px, 4vw, 64px);
  align-items: end;
  padding: clamp(28px, 4vw, 56px) var(--pad) clamp(32px, 4.4vw, 60px);
}
.hero-title {
  font-size: clamp(2.5rem, 6vw, 6rem);
  line-height: 0.98;
  font-weight: 400;
}
.hero-title .solid { font-size: 0.86em; }
.hero-side .platforms { justify-content: flex-start; margin-top: 18px; }
.hero-title .solid { display: block; }
.hero-title em { display: block; margin-top: 0.08em; }
.hero-lede { font-size: clamp(1.02rem, 1.3vw, 1.18rem); color: var(--ink-2); max-width: 46ch; }
.hero-actions, .contact-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 999px;
  text-decoration: none;
  font: 700 0.95rem/1 var(--f-body);
  transition: transform 0.35s var(--ease-out), background-color 0.25s, color 0.25s, box-shadow 0.35s var(--ease-out);
}
.btn--ink { background: var(--ink); color: var(--paper); box-shadow: var(--shadow-lift); }
.btn--ink:hover { transform: translateY(-2px); background: #000; }
.btn--ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

/* ---------- stickers ---------- */
.sticker {
  position: absolute;
  height: auto;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 14px 18px rgba(70, 20, 10, 0.25));
  animation: bob 6s ease-in-out infinite;
}
.sticker--wand { width: clamp(80px, 10vw, 170px); height: auto; right: clamp(12px, 3vw, 48px); top: clamp(-90px, -6vw, -48px); }
@keyframes bob { 0%, 100% { translate: 0 0; rotate: -4deg; } 50% { translate: 0 -10px; rotate: 3deg; } }


.platforms { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.platforms li {
  font: 700 0.85rem/1 var(--f-body);
  padding: 11px 16px;
  border-radius: 999px;
  background: #232120;
  color: var(--paper);
}
.platforms li:nth-child(2) { background: var(--sun); color: var(--ink); rotate: 3deg; }
.platforms li:nth-child(4) { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }

/* ---------- work ---------- */
.board--work { padding: var(--gutter); background: var(--paper-2); }
.work-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 40px;
  align-items: end;
  padding: clamp(32px, 5vw, 72px) calc(var(--pad) - var(--gutter)) clamp(20px, 3vw, 40px);
}
.work-head h2 { font-size: clamp(2.6rem, 6.8vw, 6.4rem); line-height: 0.92; font-weight: 400; }
.work-head h2 .solid { display: block; }
.work-head p { color: var(--ink-2); max-width: 40ch; justify-self: end; font-size: 1.05rem; }
.work-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--gutter);
}
.work-card { grid-column: span 2; }
.work-card:nth-child(5n + 1), .work-card:nth-child(5n + 2) { grid-column: span 3; }
.work-card a {
  display: block;
  height: 100%;
  text-decoration: none;
  background: var(--paper);
  border-radius: 22px;
  padding: 10px 10px 18px;
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
.work-card a:hover { transform: translateY(-6px) rotate(-0.6deg); box-shadow: 0 26px 40px -22px rgba(31, 29, 28, 0.45); }
.work-card figure { position: relative; margin: 0; border-radius: 15px; overflow: hidden; aspect-ratio: 4 / 3; background: #e8e3dc; }
.work-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease-out); }
.work-card a:hover img { transform: scale(1.04); }
.badge {
  position: absolute; left: 12px; top: 12px;
  font: 700 0.75rem/1 var(--f-body);
  padding: 8px 11px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
}
.work-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 8px 0; }
.work-meta h3 { font: 700 1.12rem/1.2 var(--f-body); letter-spacing: -0.01em; }
.work-meta p { font-size: 0.86rem; color: var(--ink-2); text-align: right; }

/* ---------- 4 about (editorial) ---------- */
.board--about {
  background: var(--yellow);
  padding: clamp(56px, 7vw, 110px) var(--pad) 0;
}
.about-name {
  position: relative;
  font: 500 clamp(6rem, 24vw, 22rem)/0.78 var(--f-serif);
  letter-spacing: -0.04em;
  text-align: center;
  color: var(--ink);
}
.about-latin { position: relative; z-index: 1; }
.about-arabic {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 52%;
  translate: -78% -50%;
  rotate: -6deg;
  font: 700 0.62em/1 var(--f-ar);
  letter-spacing: 0;
  color: #fff;
  -webkit-text-stroke: 0.012em var(--ink);
  paint-order: stroke fill;
}
.about-name sup { font: 500 1.1rem/1 var(--f-serif); vertical-align: top; position: relative; top: 1.4em; letter-spacing: 0; }
.about-line {
  max-width: 24ch;
  margin: clamp(40px, 6vw, 80px) auto 0;
  text-align: center;
  font: 500 clamp(1.7rem, 3.6vw, 3.2rem)/1.22 var(--f-serif);
  letter-spacing: -0.02em;
}
.inline-pic {
  display: inline-block;
  width: 1.9em;
  height: 0.95em;
  object-fit: cover;
  border-radius: 999px;
  vertical-align: -0.12em;
  margin: 0 0.06em;
  box-shadow: 0 6px 12px -6px rgba(31, 29, 28, 0.5);
}
.inline-pic--round { width: 0.95em; border-radius: 50%; }
.jobs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 900px;
  margin: clamp(48px, 6vw, 80px) auto 0;
  border-top: 1.5px solid var(--ink);
}
.jobs div { padding: 18px 12px; border-right: 1px solid rgba(31, 29, 28, 0.25); text-align: center; }
.jobs div:last-child { border-right: 0; }
.jobs dt { font: 800 1.05rem/1.2 var(--f-wide); }
.jobs dd { margin: 4px 0 0; font-size: 0.9rem; color: #3b3128; }
.wave { margin: clamp(20px, 4vw, 48px) calc(-1 * var(--pad)) 0; height: clamp(120px, 16vw, 240px); }
.wave svg { width: 100%; height: 100%; overflow: visible; }
.wave-text { font: 500 italic 64px var(--f-serif); fill: var(--ink); letter-spacing: -0.5px; }

/* ---------- 5 process ---------- */
.board--process {
  padding: clamp(56px, 7vw, 110px) var(--pad) clamp(64px, 8vw, 130px);
  text-align: center;
  background:
    radial-gradient(40% 50% at 50% 62%, rgba(176, 236, 90, 0.38) 0%, transparent 70%),
    #fbfbf9;
}
.process-kicker { font: italic 500 1.1rem/1.2 var(--f-serif); color: var(--ink-2); }
.board--process h2 { font: 500 clamp(2.4rem, 5.6vw, 5rem)/1.05 var(--f-body); letter-spacing: -0.035em; margin-top: 8px; }
.steps {
  list-style: none;
  padding: 0;
  margin: clamp(48px, 6vw, 84px) auto 0;
  max-width: 1080px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.4vw, 32px);
  text-align: left;
  position: relative;
  z-index: 2;
}
.step {
  background: #f3f3f1;
  border-radius: 18px;
  padding: 26px 24px 28px;
  min-height: clamp(280px, 30vw, 380px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 50px -30px rgba(31, 29, 28, 0.35), 0 2px 4px rgba(31, 29, 28, 0.06);
  transition: rotate 0.6s var(--ease-out), translate 0.6s var(--ease-out);
}
.step--1 { rotate: -4deg; translate: 0 28px; }
.step--2 { rotate: 2.5deg; }
.step--3 { rotate: -1.5deg; translate: 0 40px; }
.step:hover { rotate: 0deg; }
.step-n { font: 400 clamp(2.6rem, 4.4vw, 3.6rem)/1 var(--f-body); letter-spacing: -0.04em; }
.step h3 { margin-top: auto; font: 500 clamp(1.5rem, 2.2vw, 2rem)/1.1 var(--f-body); letter-spacing: -0.03em; }
.step p { margin-top: 10px; color: var(--ink-2); font-size: 0.95rem; }
.steps-wrap { position: relative; max-width: 1080px; margin: clamp(48px, 6vw, 84px) auto 0; }
.steps-wrap .steps { margin-top: 0; }
.steps-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 3;
  pointer-events: none;
  fill: none;
  stroke: var(--lime);
  stroke-width: 3.5;
  stroke-linecap: round;
}
.steps-line path, .steps-line circle { vector-effect: non-scaling-stroke; }
.steps-line circle { fill: #fbfbf9; stroke-width: 3.5; }
.steps-line path { stroke-dasharray: 900; stroke-dashoffset: 900; }
.board--process.in .steps-line path { stroke-dashoffset: 0; transition: stroke-dashoffset 2.2s var(--ease-out) 0.6s; }
html:not(.js) .steps-line path { stroke-dashoffset: 0; }

/* ---------- 6 services ---------- */
.board--services { padding: clamp(56px, 7vw, 110px) var(--pad) var(--pad); overflow: visible; }
.services-title { font-size: clamp(2.6rem, 6.8vw, 6.4rem); line-height: 0.92; font-weight: 400; margin-bottom: clamp(28px, 4vw, 56px); }
.services-title .solid { display: block; }
.svc-stack { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 1.6vw, 24px); }
.svc {
  position: relative;
  min-height: clamp(380px, 34vw, 480px);
  border-radius: 28px;
  padding: clamp(24px, 3.4vw, 48px);
  color: #fff;
  --stroke: #fff;
  background: linear-gradient(120deg, var(--orange-a) 0%, var(--orange-b) 100%);
  overflow: hidden;
  box-shadow: 0 -18px 40px -24px rgba(90, 20, 10, 0.45);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}
.svc--2 { background: linear-gradient(120deg, #f08a3c 0%, #d9493f 100%); }
.svc--3 { background: linear-gradient(120deg, #2b2726 0%, #4a3a33 100%); }
.svc-n { font: italic 700 1.4rem/1 var(--f-serif); }
.svc h3 { font-size: clamp(2.2rem, 3.6vw, 3.6rem); line-height: 1; font-weight: 400; margin-top: auto; }
.svc h3 .solid { display: block; color: #fff; font-size: 0.86em; }
.svc h3 em { color: #fff; }
.svc > p:last-of-type { max-width: 40ch; font-size: clamp(0.98rem, 1.1vw, 1.08rem); color: #fff7ef; }
.svc-sticker {
  position: absolute;
  top: clamp(18px, 2.6vw, 36px);
  right: clamp(18px, 2.6vw, 36px);
  width: clamp(72px, 8.5vw, 124px);
  height: auto;
  filter: drop-shadow(0 16px 16px rgba(60, 10, 0, 0.3));
  animation: bob 7s ease-in-out infinite;
}
.svc--2 .svc-sticker { animation-delay: -2.3s; }
.svc--3 .svc-sticker { animation-delay: -4.6s; }

/* ---------- 7 contact ---------- */
.board--contact {
  padding: clamp(72px, 10vw, 150px) var(--pad);
  text-align: center;
  background: radial-gradient(55% 60% at 50% 100%, #ffe2d6 0%, transparent 70%), var(--paper);
}
.board--contact h2 { font-size: clamp(2.6rem, 7vw, 6.6rem); line-height: 0.98; font-weight: 400; }
.board--contact h2 .solid { display: block; font-size: 0.86em; }
.board--contact > p { margin: 20px auto 0; color: var(--ink-2); font-size: 1.1rem; max-width: 40ch; }
.contact-actions { justify-content: center; }
.sticker--heart { width: clamp(70px, 9vw, 140px); left: clamp(14px, 8vw, 150px); top: clamp(24px, 5vw, 80px); }
.board--contact .sticker--cursor { width: clamp(56px, 7vw, 110px); right: clamp(14px, 9vw, 170px); bottom: clamp(20px, 5vw, 80px); left: auto; animation-delay: -3s; }
.board--contact .sticker--smiley { width: clamp(56px, 7vw, 110px); right: clamp(18px, 12vw, 230px); top: clamp(30px, 6vw, 100px); animation-delay: -1.5s; }

/* ---------- footer ---------- */
.foot {
  position: relative; z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  padding: 18px 8px 8px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot-links { display: flex; gap: 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .svc-stack { grid-template-columns: 1fr; }
  .svc { min-height: 0; }
  .svc h3 { font-size: clamp(2.2rem, 7vw, 3.6rem); margin-top: 8px; }
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .work-card, .work-card:nth-child(5n + 1), .work-card:nth-child(5n + 2) { grid-column: auto; }
  .work-card:nth-child(5n + 1) { grid-column: span 2; }
  .hero-strip { grid-template-columns: 1fr; align-items: start; }
}
@media (max-width: 760px) {
  body { padding-top: calc(var(--gutter) + 66px); }
  .nav-links a:nth-child(n + 3) { display: none; }
  .nav-links a, .nav-cta { padding: 12px 13px; font-size: 0.82rem; }
  .nav-mark { width: 38px; height: 38px; }
  .work-head { grid-template-columns: 1fr; }
  .work-head p { justify-self: start; }
  .work-grid { grid-template-columns: 1fr; }
  .work-card, .work-card:nth-child(5n + 1), .work-card:nth-child(5n + 2) { grid-column: auto; }
  .steps { grid-template-columns: 1fr; max-width: 420px; gap: 28px; }
  .step { min-height: 220px; }
  .step--1, .step--3 { translate: 0 0; }
  .steps-line { display: none; }
  .jobs { grid-template-columns: 1fr; }
  .jobs div { border-right: 0; border-bottom: 1px solid rgba(31, 29, 28, 0.25); }
  .svc-sticker { width: 58px; top: 18px; right: 16px; }
  .board--hero .scene { aspect-ratio: 4 / 5; max-height: none; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .board--contact { padding-top: 104px; }
  .board--contact .sticker--cursor { display: none; }
  .sticker--heart { top: 22px; left: 20px; width: 58px; }
  .board--contact .sticker--smiley { top: 26px; right: 22px; width: 50px; }
  .about-arabic { translate: -70% -50%; }
  .scene-hint { font-size: 0.68rem; padding: 7px 11px; bottom: 10px; }
  .scene--contact .scene-hint { top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .board { clip-path: none; transform: none; opacity: 1; }
  .steps-line path { stroke-dashoffset: 0; }
}
