/* Abdulaziz Bin Odah — portfolio. Direction: "The name as a monument" (see docs/04-design-brief.md). */

@font-face { font-family: "Bebas Neue"; src: url("../fonts/bebas-neue-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fonts/eb-garamond-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("../fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  --ground: #0F1D31;
  --ground-step: #16273F;
  --ink: #F1EBDD;
  --ink-soft: #A9B6C8;
  --accent: #C3A06A;
  --accent-ink: #0F1D31;

  --font-display: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
  --font-text: "EB Garamond", Georgia, "Times New Roman", serif;

  --step-small: clamp(0.875rem, 0.84rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.5rem, 1.2rem + 5vw, 5.5rem);
  /* The name, fitted to the width: "ABDULAZIZ BIN ODAH" in Bebas Neue is 5.89em wide, "ABDULAZIZ" 3.10em. */
  --step-monument: min(calc((100vw - 2 * var(--margin)) / 5.95), 30svh);

  --margin: 24px;
  --gutter: clamp(1rem, 2vw, 2rem);
  --section: clamp(7.5rem, 14vw, 15rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 240ms;
}
@media (max-width: 47.99em) { :root { --margin: 16px; } }

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--ground); }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font-text); font-size: var(--step-body); line-height: 1.45; font-kerning: normal; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, p, figure, ul, ol, dl, dd { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--margin); top: -100px; z-index: 10; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- hero: name under a photograph ---------- */
.hero { position: relative; min-height: 100svh; display: grid; grid-template-rows: 60svh auto 1fr; }
.hero__photo { position: relative; overflow: hidden; background: #2a1d10; }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 41%; }
.nav { position: absolute; top: 0; right: 0; z-index: 2; display: flex; gap: 28px; padding: 14px var(--margin) 14px 28px; background: var(--ground); }
.nav a { color: var(--ink); padding-block: 6px; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 6px; text-decoration-thickness: 1px; transition: text-decoration-color var(--t-hover) var(--ease-out); }
.nav a:hover { text-decoration-color: currentColor; }
.nav__menu { display: none; }

.hero__row { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px var(--margin) 0; }
.hero__sentence { font-size: var(--step-lead); line-height: 1.3; max-width: 34ch; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; background: var(--accent); color: var(--accent-ink); font-family: var(--font-text); font-weight: 500; text-decoration: none; border-radius: 0; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) var(--ease-out); }
.btn:hover { background: #D2B17E; }
.btn:active { transform: scale(0.97); }

.cv-menu { position: relative; flex-shrink: 0; }
.cv-menu__list { position: absolute; right: 0; top: calc(100% + 8px); min-width: 260px; background: var(--ink); color: var(--ground); padding: 8px 0; z-index: 3; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); } /* taste-skill-ignore: real overlay menu */
.cv-menu__list[hidden] { display: none; }
.cv-menu__list a { display: block; padding: 12px 18px; text-decoration: none; }
.cv-menu__list a:hover, .cv-menu__list a:focus-visible { background: #E4DCC9; outline: none; }

.hero__name { align-self: end; padding: 0 var(--margin) 20px; font-family: var(--font-display); font-weight: 400; font-size: var(--step-monument); line-height: 0.85; letter-spacing: -0.02em; text-transform: uppercase; white-space: nowrap; transform-origin: 50% 100%; }
.hero__name .line { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: 0.02em; }
.hero__name .line > span { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .js-pre .hero__name .line > span { transform: translateY(105%); }
  .js-pre .hero__row > * { opacity: 0; }
}

@media (max-width: 47.99em) {
  .hero { grid-template-rows: 50svh auto auto; min-height: auto; }
  .hero__photo img { object-position: 50% 20%; }
  .nav a { display: none; }
  .nav__menu { display: inline-block; }
  .hero__row { flex-direction: column; align-items: flex-start; gap: 18px; padding-top: 24px; }
  .hero__sentence { font-size: var(--step-lead); }
  .hero__name { --step-monument: calc((100vw - 2 * var(--margin)) / 3.16); white-space: normal; padding-top: 28px; padding-bottom: 16px; }
  .hero__name .line { display: block; }
}

/* ---------- phone menu ---------- */
.menu { position: fixed; inset: 0; z-index: 20; background: var(--ground); padding: 24px var(--margin); display: flex; flex-direction: column; }
.menu[hidden] { display: none; }
.menu__close { align-self: flex-end; padding: 6px 0; }
.menu a { font-family: var(--font-display); font-size: 18vw; line-height: 0.95; text-decoration: none; text-transform: uppercase; }

/* ---------- shared ---------- */
.next { padding: var(--section) var(--margin); }
.wrap { padding-inline: var(--margin); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.section { padding-block: calc(var(--section) / 2); }
.h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--step-head); line-height: 0.9; letter-spacing: -0.01em; text-transform: uppercase; }
.lead { font-size: var(--step-lead); line-height: 1.32; }
.small { font-size: var(--step-small); line-height: 1.45; }
.soft { color: var(--ink-soft); }
.shot { display: block; background: var(--ground-step); }
.shot img { width: 100%; height: auto; display: block; }
.stack { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--ink-soft); }
.stack li::before { content: ""; }
.textlink { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; transition: color var(--t-hover) var(--ease-out); }
.textlink:hover { color: var(--ink); }

/* ---------- work index: names passing a held square ---------- */
.index { position: relative; padding-block: calc(var(--section) / 2) calc(var(--section) / 2); }
.index__layer { position: absolute; inset: 0; pointer-events: none; }
.index__frame { position: sticky; top: calc(50svh - min(15.5vw, 225px)); width: min(31vw, 450px); aspect-ratio: 1; margin: 0 auto; z-index: 0; background: var(--ground-step); overflow: hidden; }
.index__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 0 0; opacity: 0; transition: opacity 200ms var(--ease-out); }
.index__frame img.is-on { opacity: 1; }
.index__frame::after { content: ""; position: absolute; inset: 0; background: rgba(15, 29, 49, 0.62); }
.index__facts { position: sticky; top: calc(50svh - 0.7em); height: 0; z-index: 2; display: flex; justify-content: space-between; padding-inline: var(--margin); pointer-events: none; }
.index__facts span { width: calc(50% - min(15.5vw, 225px) - 48px); }
.index__facts span:last-child { text-align: right; }
.index__title, .index__list li { font-family: var(--font-display); font-weight: 400; font-size: clamp(96px, 14vw, 200px); line-height: 0.85; text-transform: uppercase; letter-spacing: -0.02em; }
.index__title { position: relative; z-index: 1; text-align: center; color: var(--ink-soft); padding-top: 30svh; }
.index__list { position: relative; z-index: 1; text-align: center; padding-block: 0 30svh; }
.index__list li { padding-block: 12svh; }
.index__list a { text-decoration: none; display: inline-block; transition: color var(--t-hover) var(--ease-out); }
.index__list a:hover { color: var(--accent); }
@media (max-width: 47.99em) {
  .index__frame { top: calc(50svh - 30vw); width: 60vw; }
  .index__facts { top: calc(50svh + 30vw + 12px); justify-content: center; gap: 16px; }
  .index__facts span { width: auto; }
  .index__title, .index__list li { font-size: 15vw; }
  .index__list li { padding-block: 16svh; }
}

/* ---------- project details ---------- */
.project { padding-block: calc(var(--section) / 2); }
.project__head { grid-column: 1 / span 5; }
.project__name { font-family: var(--font-display); font-weight: 400; font-size: var(--step-head); line-height: 0.9; text-transform: uppercase; letter-spacing: -0.01em; }
.project__meta { margin-top: 14px; color: var(--ink-soft); }
.project__text { grid-column: 7 / span 6; display: grid; gap: 18px; align-content: start; }
.project__text p { max-width: 58ch; }
.project__facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; }
.project__facts dt { color: var(--ink-soft); }
.project__pics { grid-column: 1 / -1; margin-top: 56px; display: grid; gap: var(--gutter); align-items: end; }
.project--lunch .project__pics { grid-template-columns: 8fr 3fr; }
.project--aqua .project__pics { grid-template-columns: repeat(3, 1fr) 3.6fr; align-items: end; }
.project--rawafid { background: var(--ground-step); }
.project--rawafid .project__head { grid-column: 8 / span 5; grid-row: 1; }
.project--rawafid .project__text { grid-column: 8 / span 5; grid-row: 2; margin-top: 24px; }
.project--rawafid .project__pics { grid-column: 1 / span 7; grid-row: 1 / span 3; margin-top: 0; grid-template-columns: 1fr; }
@media (max-width: 47.99em) {
  .project__head, .project__text, .project__pics, .project--rawafid .project__head, .project--rawafid .project__text, .project--rawafid .project__pics { grid-column: 1 / -1; grid-row: auto; }
  .project__text { margin-top: 20px; }
  .project__facts { grid-template-columns: 1fr; gap: 2px; }
  .project__facts dd + dt { margin-top: 12px; }
  .project__pics { margin-top: 32px; }
  .project--lunch .project__pics { grid-template-columns: 1fr; }
  .project--lunch .project__pics .shot:last-child { width: 62%; justify-self: end; }
  .project--aqua .project__pics { grid-template-columns: 1fr 1fr; }
  .project--aqua .project__pics .shot:last-child { grid-column: 1 / -1; }
  .project--aqua .project__pics .shot:nth-child(3) { display: none; }
  .project--rawafid .project__pics { margin-top: 0; margin-bottom: 28px; }
}

/* ---------- live demo: the lunch bot in the browser ---------- */
.demo { margin-top: 96px; display: grid; grid-template-columns: 4fr 4fr 4fr; gap: var(--gutter); align-items: start; }
.demo__h { font-family: var(--font-display); font-weight: 400; font-size: var(--step-head); line-height: 0.9; text-transform: uppercase; }
.demo__intro p { margin-top: 18px; max-width: 36ch; }
.demo__chat { background: #0B141A; color: #E9EDEF; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; display: grid; grid-template-rows: auto 1fr auto; height: 460px; }
.demo__top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #202C33; }
.demo__top small { display: block; color: #8696A0; font-size: 13px; }
.demo__avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 13px; }
.demo__log { list-style: none; margin: 0; padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 8px; line-height: 1.4; transition: opacity 260ms var(--ease-out), transform 260ms var(--ease-out); }
.msg.is-new { opacity: 0; transform: translateY(8px); }
.msg--bot { background: #202C33; align-self: flex-start; }
.msg--you { background: #005C4B; align-self: flex-end; }
.msg__day { display: block; color: #8696A0; font-size: 13px; margin-bottom: 4px; }
.msg__ar { display: block; margin-top: 6px; color: #D1D7DB; }
.demo__replies { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px 16px; background: #0B141A; }
.reply { min-height: 44px; border-radius: 8px; background: #202C33; color: #53BDEB; font-weight: 600; transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) var(--ease-out); }
.reply:hover { background: #2A3942; }
.reply:active { transform: scale(0.96); }
.reply[aria-pressed="true"] { background: #005C4B; color: #E9EDEF; }
.reply:disabled { opacity: 0.5; cursor: default; }
.demo__host { background: var(--ground-step); padding: 24px; height: 460px; display: flex; flex-direction: column; gap: 14px; }
.demo__label { color: var(--ink-soft); }
.demo__count { font-family: var(--font-display); font-size: 120px; line-height: 0.85; font-variant-numeric: tabular-nums; }
.demo__unit { font-size: 40px; }
.demo__guests { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.demo__guests li { padding: 4px 12px; border-radius: 999px; transition: background-color var(--t-ui) var(--ease-out), color var(--t-ui) var(--ease-out); }
.demo__guests [data-state="yes"] { background: var(--accent); color: var(--accent-ink); }
.demo__guests [data-state="no"] { background: transparent; color: var(--ink-soft); text-decoration: line-through; }
.demo__guests [data-state="wait"] { background: var(--ground); color: var(--ink-soft); }
.demo__status { margin-top: auto; }
.demo__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.demo__actions .btn:disabled { opacity: 0.45; cursor: default; }
.demo__reset { text-decoration: underline; text-underline-offset: 4px; color: var(--ink-soft); }
.demo__reset:hover { color: var(--ink); }
@media (max-width: 63.99em) {
  .demo { grid-template-columns: 1fr 1fr; }
  .demo__intro { grid-column: 1 / -1; }
}
@media (max-width: 47.99em) {
  .demo { grid-template-columns: 1fr; margin-top: 72px; }
  .demo__chat { height: 420px; }
  .demo__host { height: auto; }
  .demo__count { font-size: 96px; }
}

/* ---------- about: side facts, wide paragraph (inverse field) ---------- */
.about { background: var(--ink); color: var(--ground); padding-block: calc(var(--section) * 0.75); }
.about .soft { color: #4A5A70; }
.about__row { display: grid; grid-template-columns: 160px 1fr; column-gap: calc(34vw - 160px - var(--margin)); }
.about__row + .about__row { margin-top: 120px; }
.about__facts { display: grid; gap: 20px; align-content: start; }
.about__facts dt { color: #4A5A70; }
.about__para { font-size: var(--step-lead); line-height: 1.35; max-width: none; width: min(100%, 56vw); }
.about__para + .about__para { margin-top: 0.9em; }
.about__h { font-family: var(--font-display); font-weight: 400; font-size: var(--step-head); line-height: 0.9; text-transform: uppercase; }
.about__lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 64px; max-width: 56vw; }
.role { display: grid; gap: 8px; }
.role + .role { margin-top: 36px; }
.role__top { display: flex; justify-content: space-between; gap: 16px; font-weight: 500; }
.role__top span { font-weight: 400; color: #4A5A70; font-variant-numeric: tabular-nums; white-space: nowrap; }
.role ul { padding-left: 1.1em; display: grid; gap: 4px; }
.edu { display: grid; gap: 6px; margin-top: 20px; }
.edu + .about__h { margin-top: 44px; }
@media (max-width: 63.99em) {
  .about__row { grid-template-columns: 1fr; row-gap: 32px; }
  .about__facts { grid-template-columns: 1fr 1fr; order: 2; }
  .about__para, .about__lists { width: 100%; max-width: none; }
  .about__lists { grid-template-columns: 1fr; gap: 48px; }
}

/* ---------- skills: giant word, filled bars ---------- */
.skills { padding-block: var(--section); }
.skills__col { width: min(100%, 620px); margin-inline: auto; container-type: inline-size; }
.skills__word { font-family: var(--font-display); font-weight: 400; font-size: 44cqw; line-height: 0.8; text-transform: uppercase; letter-spacing: -0.02em; text-align: center; }
.skills__bars { margin-top: 20px; display: grid; gap: 6px; }
.bar { background: var(--ground-step); }
.bar summary { display: flex; justify-content: space-between; align-items: center; min-height: 56px; padding: 0 18px; font-weight: 500; cursor: pointer; list-style: none; transition: background-color var(--t-hover) var(--ease-out); }
.bar summary::-webkit-details-marker { display: none; }
.bar summary:hover { background: #1C3150; }
.bar summary::after { content: "+"; font-size: 22px; font-weight: 400; transition: transform var(--t-ui) var(--ease-out); }
.bar[open] summary::after { transform: rotate(45deg); }
.bar ul { list-style: none; padding: 4px 18px 20px; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.bar__note { padding: 0 18px 18px; font-size: var(--step-small); color: var(--ink-soft); }

/* ---------- certifications: names as one statement ---------- */
.certs { padding-block: 0 var(--section); }
.certs__statement { font-size: clamp(26px, 2.5vw, 36px); line-height: 1.25; max-width: 40ch; }
.certs__statement .lit { color: var(--ink); transition: color 400ms var(--ease-out); }
.certs__statement .dim { color: var(--ink-soft); }
.certs__list { margin-top: 56px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px var(--gutter); }
.certs__list li { display: grid; gap: 4px; }
.certs__list b { font-weight: 500; }

/* ---------- contact: map band, then address in display rows ---------- */
.place { position: relative; overflow: hidden; }
.place picture, .place img { width: 100%; height: auto; display: block; }
.place__label { position: absolute; left: var(--margin); right: var(--margin); bottom: 28px; display: flex; justify-content: space-between; align-items: end; gap: 24px; pointer-events: none; }
.place__city { font-family: var(--font-display); font-size: clamp(96px, 14vw, 200px); line-height: 0.82; text-transform: uppercase; letter-spacing: 0.04em; }
.place__coords { color: var(--ink); font-variant-numeric: tabular-nums; padding-bottom: 8px; }
.contact__rows { display: grid; }
.contact__row { display: flex; align-items: flex-end; min-height: clamp(96px, 10.4vw, 150px); padding: 0 var(--margin) 18px 20px; font-family: var(--font-display); font-size: var(--step-head); line-height: 1; text-transform: uppercase; text-decoration: none; letter-spacing: 0.01em; }
.contact__row:nth-child(odd) { background: var(--ground-step); }
a.contact__row { transition: color var(--t-hover) var(--ease-out); }
a.contact__row:hover { color: var(--accent); }
.contact__row--email { text-transform: none; font-family: var(--font-text); letter-spacing: -0.01em; }
.contact__hello { display: flex; align-items: center; gap: 24px; }
.round { display: inline-grid; place-items: center; width: 0.9em; height: 0.9em; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-family: var(--font-text); font-size: 1em; transition: transform var(--t-press) var(--ease-out); }
.round svg { width: 42%; height: 42%; }
.contact__hello:hover .round { transform: translateX(6px); }
.contact__hello:active .round { transform: scale(0.94); }
@media (max-width: 47.99em) {
  .place__city { font-size: 15vw; }
  .place__label { bottom: 14px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .contact__row { font-size: var(--step-head); min-height: 84px; padding-left: 16px; }
  .contact__row--email { font-size: 6.6vw; }
  .contact__row.contact__row--hello { background: var(--accent); color: var(--accent-ink); justify-content: space-between; }
  .contact__row--hello .round { background: var(--ground); color: var(--ink); width: 56px; height: 56px; }
}

/* ---------- footer: columns above, wordmark below ---------- */
.page { position: relative; z-index: 1; background: var(--ground); }
.footer { position: sticky; bottom: 0; z-index: 0; min-height: 100svh; display: grid; grid-template-rows: auto 1fr auto; background: var(--ink); color: var(--ground); padding: 40px var(--margin) 20px; }
.footer__cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gutter); }
.footer__cols li:first-child { font-weight: 500; }
.footer__cols li + li { color: #4A5A70; margin-top: 4px; }
.footer__cols a { text-decoration: none; }
.footer__cols a:hover { text-decoration: underline; }
.footer__mark { width: 100%; height: auto; fill: var(--ground); margin-bottom: 20px; }
.footer__legal { font-size: 13px; color: #4A5A70; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 47.99em) {
  .footer__cols { grid-template-columns: 1fr 1fr; row-gap: 32px; }
}

/* Portrait tablets: stack the name like the phone, so it fills the screen instead of leaving a gap. */
@media (min-width: 48em) and (max-width: 63.99em) and (orientation: portrait) {
  .hero { grid-template-rows: 50svh auto 1fr; }
  .hero__name { --step-monument: calc((100vw - 2 * var(--margin)) / 3.16); white-space: normal; }
  .hero__name .line { display: block; }
}
@media (max-width: 47.99em) { .certs__statement { font-size: 22px; } }

/* ---------- 404 ---------- */
.notfound { min-height: 100svh; display: grid; align-content: center; }
.notfound__h { padding: 0; white-space: normal; }

/* ---------- print: dark ink on white, no screen-only parts ---------- */
@media print {
  :root { --ground: #fff; --ground-step: #fff; --ink: #111; --ink-soft: #444; }
  body, .page, .about, .footer, .project--rawafid, .contact__row { background: #fff !important; color: #111 !important; }
  .nav, .skip, .menu, .cv-menu, .demo, .index__layer, .place, .footer__mark { display: none !important; }
  .footer { position: static; min-height: 0; }
  .hero { min-height: 0; }
  [style*="opacity"] { opacity: 1 !important; transform: none !important; }
  .index__title { padding-top: 2rem; }
  .index__list li { padding-block: 1.5rem; }
  a { color: #111; }
}
