/* Design tokens — edit the palette, content width, and fonts here. */
:root {
  color-scheme: dark;
  --bg: #111413;
  --panel: #181c1a;
  --text: #f0f2ec;
  --muted: #a8b0aa;
  --accent: #d3ed9c;
  --line: #343b36;
  --width: 1120px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, dl, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
img, video { display: block; max-width: 100%; height: auto; }
.wrap { width: min(var(--width), calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 10; top: -100px; left: 20px; padding: 12px 18px; color: var(--bg); background: var(--accent); }
.skip-link:focus { top: 12px; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 88px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 1.125rem; letter-spacing: -.4px; }
.brand-name > span { color: var(--accent); margin-left: 6px; }
.site-header nav { display: flex; gap: clamp(16px, 3vw, 32px); }
.site-header nav a { padding-block: 12px; font-size: .875rem; color: var(--muted); }
.site-header nav a:hover { color: var(--text); }
.eyebrow, .project-meta, .experience-type { font: .75rem/1.5 var(--mono); letter-spacing: 1.2px; }
.eyebrow { color: var(--accent); margin-bottom: 20px; }
.hero { padding-block: 64px 42px; }
h1 { max-width: 1030px; font-size: clamp(2.55rem, 5.4vw, 4.5rem); line-height: 1.09; letter-spacing: -.045em; font-weight: 600; text-wrap: balance; }
h1 span { color: var(--accent); }
.hero-intro { color: var(--muted); max-width: 640px; font-size: 1.125rem; line-height: 1.65; margin-top: 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 24px; padding: 12px 20px; min-height: 48px; border: 1px solid var(--accent); border-radius: 5px; background: var(--accent); color: var(--bg); font-size: .875rem; font-weight: 650; transition: background .15s, border-color .15s; }
.button:hover { background: #e0f4b7; border-color: #e0f4b7; color: var(--bg); }
.button-secondary { background: transparent; color: var(--text); border-color: var(--line); }
.button-secondary:hover { background: var(--panel); color: var(--text); border-color: var(--muted); }
.hero-context { display: flex; flex-wrap: wrap; column-gap: 26px; row-gap: 8px; border-top: 1px solid var(--line); margin-top: 42px; padding-top: 18px; font-size: .8125rem; color: var(--muted); }
.hero-context a { margin-left: auto; color: var(--text); }
.section { padding-block: 58px; }
h2 { font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 550; line-height: 1.18; letter-spacing: -.035em; text-wrap: balance; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 32px; }
.section-heading > p { max-width: 330px; color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: 18px; min-height: 44px; font-size: .875rem; font-weight: 600; margin-top: 18px; }
.text-link span { color: var(--accent); }
.capabilities { display: grid; grid-template-columns: 1fr 1.65fr; gap: 60px; border-top: 1px solid var(--line); margin-top: 24px; }
.capability-list > div { padding-block: 18px; border-bottom: 1px solid var(--line); }
.capability-list > div:first-child { padding-top: 0; }
.capability-list > div:last-child { border-bottom: 0; }
.capability-list dt { font-weight: 550; }
.capability-list dd { margin: 5px 0 0; color: var(--muted); font-size: .875rem; }
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; border-top: 1px solid var(--line); }
.about-intro > p:not(.eyebrow) { color: var(--muted); margin-top: 24px; max-width: 420px; }
.experience-list article { padding-block: 24px; border-bottom: 1px solid var(--line); }
.experience-list article:first-of-type { padding-top: 0; }
.experience-list article:last-child { border-bottom: 0; padding-bottom: 0; }
.experience-type { color: var(--muted); margin-bottom: 12px; }
.experience-list h3 { font-size: 1.125rem; font-weight: 550; }
.experience-list article > p:not(.experience-type) { color: var(--muted); margin-top: 10px; }
.contact { padding-block: 64px 58px; border-top: 1px solid var(--line); }
.contact h2 { font-size: clamp(2rem, 4vw, 3.25rem); }
.contact > p:not(.eyebrow) { max-width: 580px; margin-top: 20px; color: var(--muted); }
.contact-form { max-width: 760px; margin-top: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field-wide { grid-column: 1 / -1; }
.form-field label { font-size: .875rem; font-weight: 550; }
.form-field label > span:not(.optional) { color: var(--accent); }
.form-field .optional { color: var(--muted); font-weight: 400; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 5px; outline: none; background: var(--panel); color: var(--text); font: inherit; }
.form-field textarea { min-height: 150px; resize: vertical; }
.form-field input::placeholder { color: #858e87; }
.form-field input:focus-visible, .form-field select:focus-visible, .form-field textarea:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
.form-honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.form-footer { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 20px; margin-top: 24px; }
.form-footer .button { cursor: pointer; font-family: inherit; }
.form-footer .button:disabled { opacity: .65; cursor: wait; }
.form-status { color: var(--muted); font-size: .875rem; }
.form-status[data-state="success"] { color: var(--accent); }
.form-status[data-state="error"] { color: #f4b7ab; }
.contact > .email-fallback { margin-top: 18px; font-size: .875rem; }
.email-fallback a { color: var(--text); text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 4px; }
.email-fallback a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.professional-links { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 32px; }
.professional-links a { font-size: .875rem; min-height: 44px; display: inline-flex; align-items: center; gap: 10px; }
.professional-links span { color: var(--accent); }
.site-footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; padding-block: 24px; font-size: .8125rem; }
.site-footer p span, .site-footer a { color: var(--muted); }
@media (max-width: 900px) {
  .capabilities, .about { gap: 36px; }
}
@media (max-width: 680px) {
  .site-header { min-height: 76px; }
  .brand { font-size: 1rem; }
  .hero { padding-top: 48px; }
  .desktop-break { display: none; }
  .hero-context { display: grid; gap: 6px; }
  .hero-context a { margin-left: 0; }
  .section { padding-block: 42px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 18px; max-width: 100%; }
  .capabilities, .about { grid-template-columns: 1fr; }
  .capabilities { gap: 28px; }
  .about { gap: 32px; }
  .contact { padding-block: 48px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field-wide { grid-column: auto; }
}
@media (max-width: 360px) {
  .site-header { flex-wrap: wrap; padding-block: 16px; gap: 8px; }
  .site-header nav { width: 100%; }
  .site-footer { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Personal photo: original-resolution image with a face-focused CSS crop. */
.avatar { display: block; flex-shrink: 0; border-radius: 50%; overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 63% 40%; transform: scale(2.5); transform-origin: 63% 38%; }
.avatar-small { width: 36px; height: 36px; }
@media (min-width: 361px) and (max-width: 400px) {
  .site-header { gap: 12px; }
  .site-header nav { gap: 14px; }
  .brand { gap: 8px; }
  .brand-name > span { margin-left: 2px; }
}

/* Background photo sits above Education, separate from the header avatar. */
.about-portrait { width: min(100%, 280px); aspect-ratio: 4 / 3; margin: 0 0 28px; overflow: hidden; border-radius: 8px; }
.about-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 58%; }

/* Shared project stage. Covers use one compact browser frame; gallery photographs remain unframed. */
button { font: inherit; color: inherit; cursor: pointer; }
.showcase-track { display: block; height: 340vh; }
.showcase-stage { position: sticky; top: 24px; padding: 22px 0 16px; background: var(--bg); }
.project-picker { display: flex; gap: 28px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.project-picker button { background: none; border: 0; padding: 8px 0; color: var(--muted); font-size: .875rem; }
.project-picker button span { font: .7rem var(--mono); margin-right: 10px; color: var(--muted); }
.project-picker button[aria-current="true"], .project-picker button:hover { color: var(--accent); }
.project-picker button[aria-current="true"] { box-shadow: 0 1px var(--accent); }
.showcase-layout { display: grid; grid-template-columns: .85fr 1.35fr; align-items: center; gap: 46px; min-height: 510px; padding-block: 32px; }
.copy-window { overflow: hidden; }
.project-category { font: .68rem/1.5 var(--mono); color: var(--muted); letter-spacing: 1px; margin-bottom: 12px; }
.project-copy h3 { font-size: clamp(1.9rem, 3vw, 2.8rem); font-weight: 550; line-height: 1.15; letter-spacing: -.035em; }
.project-lead { font-size: 1.125rem; line-height: 1.5; margin-top: 14px; }
.project-description { font-size: .875rem; color: var(--muted); margin-top: 14px; }
.feature-list { list-style: none; padding: 0; margin-top: 18px; }
.feature-list li { font-size: .8125rem; color: var(--muted); padding-left: 14px; position: relative; }
.feature-list li::before { content: '·'; position: absolute; left: 0; color: var(--accent); }
.feature-list li + li { margin-top: 5px; }
.tech-list { display: flex; flex-wrap: wrap; list-style: none; padding: 0; gap: 6px; margin-top: 18px; }
.tech-list li { font: .68rem/1.6 var(--mono); padding: 3px 7px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); }
.project-actions { display: flex; gap: 22px; }
.project-actions button { border: 0; padding: 0; background: none; }
.project-actions .live-link { color: var(--muted); font-weight: 400; }
.project-preview { display: block; width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: #202622; padding: 0; text-align: left; overflow: hidden; }
.desktop-frame { display: block; width: 100%; padding: 6px; background: #111513; border: 1px solid #4b524d; border-radius: 8px; box-shadow: 0 18px 30px #0004; transform-origin: top left; overflow: hidden; }
.device-toolbar { height: 20px; display: flex; align-items: center; gap: 4px; padding: 0 4px 5px; }
.device-toolbar i { width: 4px; height: 4px; border-radius: 50%; background: #68716a; }
.device-toolbar span { color: #a8b0aa; font: 7px var(--mono); letter-spacing: 1px; margin-left: auto; }
.screen-window { display: block; position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: #111513; }
.screen-window.is-video { aspect-ratio: 16 / 9; background: #111513; }
.screen-window img { display: block; width: 100%; height: 100%; object-fit: cover; }
.screen-window video { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project-preview:hover { border-color: #71816c; }
.showcase-footer { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 16px; font: .7rem var(--mono); color: var(--muted); }
.project-count { color: var(--accent); }
.fallback-projects { display: grid; gap: 32px; }

/* Native modal keeps keyboard focus inside the gallery; Escape returns to work. */
body.gallery-open { position: fixed; width: 100%; overflow: hidden; }
.project-dialog { position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bg); color: var(--text); overflow-y: auto; overscroll-behavior: contain; }
.project-dialog::backdrop { background: var(--bg); }
.gallery-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px max(24px,calc((100vw - 1360px) / 2)); border-bottom: 1px solid var(--line); background: var(--bg); }
.gallery-back { background: none; border: 1px solid var(--line); border-radius: 5px; padding: 10px 16px; font-size: .875rem; }
.gallery-back:hover { color: var(--accent); border-color: var(--accent); }
.gallery-project-name { color: var(--muted); font: .8rem var(--mono); }
.gallery-layout { display: grid; grid-template-columns: minmax(220px,.65fr) minmax(0,1.6fr); gap: 56px; width: min(1360px,calc(100% - 48px)); margin: 40px auto 80px; align-items: start; }
.gallery-info { position: sticky; top: 120px; }
.gallery-images { min-width: 0; display: grid; gap: 42px; }
.gallery-images figure { min-width: 0; }
.gallery-images > figure > img, .gallery-images video { display: block; width: 100%; height: auto; border-radius: 8px; background: var(--panel); }

.gallery-images figcaption { font: .75rem/1.6 var(--mono); color: var(--muted); margin-top: 14px; }
@media (max-width: 900px) {
  .showcase-layout { gap: 24px; grid-template-columns: 1fr 1.2fr; }
  .gallery-layout { gap: 28px; }
}
@media (max-width: 680px) {
  .showcase-track { height: 300svh; }
  .showcase-stage { top: 8px; padding-top: 8px; }
  .project-picker { gap: 0; justify-content: space-between; padding-bottom: 10px; }
  .project-picker button { font-size: .73rem; min-height: 40px; }
  .project-picker button span { display: none; }
  .showcase-layout { grid-template-columns: 1fr; gap: 18px; padding-block: 20px; min-height: 0; }
  .project-copy h3 { font-size: 1.8rem; }
  .project-category { margin-bottom: 6px; font-size: .6rem; }
  .project-lead { font-size: 1rem; margin-top: 8px; }
  .project-copy .project-description, .project-copy .feature-list { display: none; }
  .project-copy .tech-list { margin-top: 10px; }
  .project-actions .text-link { margin-top: 7px; font-size: .8rem; min-height: 36px; }
  .showcase-footer { padding-top: 12px; }
  .gallery-layout { display: flex; flex-direction: column; width: calc(100% - 32px); gap: 28px; margin-top: 24px; }
  .gallery-info { position: static; order: 2; }
  .gallery-images { width: 100%; gap: 28px; }
  .gallery-bar { padding: 12px 16px; }
}
@media (max-height: 670px) and (min-width: 681px) {
  .showcase-stage { top: 8px; padding-top: 8px; }
  .showcase-layout { min-height: 0; padding-block: 16px; }
  .project-copy .feature-list { display: none; }
}
@media (max-height: 600px) and (max-width: 680px) {
  .showcase-stage { position: sticky; }
  .showcase-layout { gap: 10px; padding-block: 10px; }
  .project-copy .tech-list, .project-category { display: none; }
}

/* Compact frame only in the project overview; no surrounding mockup scene. */
.project-preview { border: 0; border-radius: 8px; overflow: visible; background: transparent; }
.project-preview:hover .desktop-frame { border-color: #71816c; }
.transition-photo { position: fixed; z-index: 5; display: block; max-width: none; object-fit: fill; border-radius: 8px; transform-origin: top left; pointer-events: none; }
.project-dialog.is-closing, .project-dialog.is-closing::backdrop { background: transparent; }
.project-dialog.is-closing .gallery-bar, .project-dialog.is-closing .gallery-layout { opacity: 0; transition: opacity 220ms ease; }

/* Signup walkthrough: click to play with accessible custom controls. */
.demo-player { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #181c1a; }
.player-screen { position: relative; background: #080b09; }
.gallery-images .player-screen video { width: 100%; aspect-ratio: 16 / 9; height: auto; border-radius: 0; cursor: pointer; }
.player-start { position: absolute; inset: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #0003; border: 0; color: white; }
.player-start[hidden] { display: none; }
.player-start > svg { width: 62px; height: 62px; padding: 17px; background: var(--accent); color: var(--bg); border-radius: 50%; box-shadow: 0 4px 24px #0003; transition: transform .18s; }
.player-start:hover > svg { transform: scale(1.08); }
.player-start > span { padding: 5px 12px; border-radius: 20px; background: #111413e6; font-size: .75rem; font-weight: 550; }
.player-controls { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.player-controls button { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; padding: 9px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); }
.player-controls button:hover { color: var(--accent); background: #ffffff08; }
.player-controls svg { width: 20px; height: 20px; }
.player-time { font: .68rem var(--mono); color: var(--muted); white-space: nowrap; margin-right: 8px; }
.player-seek { --played: 0%; flex: 1; min-width: 30px; height: 4px; margin: 0 6px; appearance: none; border-radius: 4px; background: linear-gradient(to right,var(--accent) var(--played),var(--line) var(--played)); cursor: pointer; }
.player-seek::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border: 2px solid var(--accent); border-radius: 50%; background: var(--accent); }
.player-seek::-moz-range-thumb { width: 10px; height: 10px; border: 0; border-radius: 50%; background: var(--accent); }
.player-error { color: var(--muted); padding: 12px; font-size: .8rem; }
.player-error a { text-decoration: underline; }
.demo-player:fullscreen { display: flex; flex-direction: column; justify-content: center; background: #080b09; border: 0; border-radius: 0; }
.demo-player:fullscreen .player-screen { min-height: 0; flex: 1; display: grid; place-items: center; }
.demo-player:fullscreen .player-screen video { max-height: calc(100dvh - 58px); object-fit: contain; }
.demo-player:fullscreen .player-controls { flex-shrink: 0; }
@media (max-width: 680px) {
  .player-controls { gap: 3px; padding: 8px 6px; }
  .player-controls button { width: 34px; height: 36px; padding: 7px; }
  .player-time { margin-right: 2px; font-size: .6rem; }
}
/* Fill-window fallback when native fullscreen is unavailable. */
.demo-player.is-expanded { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; justify-content: center; background: #080b09; border: 0; border-radius: 0; }
.demo-player.is-expanded .player-screen { min-height: 0; flex: 1; display: grid; place-items: center; }
.demo-player.is-expanded .player-screen video { max-height: calc(100dvh - 58px); object-fit: contain; }
.demo-player.is-expanded .player-controls { flex-shrink: 0; }

/* Direct mobile capture at a readable display width, with no device mockup. */
.gallery-images .mobile-screenshot { width: min(100%, 420px); margin-inline: auto; }

/* Keep Alrifai’s poster and loaded video at the same dimensions in the gallery too. */
.gallery-cover video { aspect-ratio: 16 / 9; object-fit: cover; }
