/* Abbass Darwish, MEP design engineer. Loaded as a file so the CSP can stay at style-src 'self'. */

/* Fonts are self-hosted: the Dockerfile copies them from pinned @fontsource packages into /assets/fonts/. */
@font-face {
  font-family: "Barlow Condensed";
  src: url("/assets/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/assets/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("/assets/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/assets/fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2-variations"),
       url("/assets/fonts/ibm-plex-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 700; font-style: normal; font-display: swap;
}

:root {
  --bg: #EDF0F2;
  --panel: #F8F9FA;
  --ink: #0F202C;
  --muted: #55646F;
  --rule: #B5C0C7;
  --heat: #C4362F;
  --water: #2447C4;
  --wa: #128C4A;
  --li: #0A66C2;
  --shot: #000;
  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C1318;
    --panel: #121B21;
    --ink: #E5EBEE;
    --muted: #93A3AD;
    --rule: #2A3A44;
    --heat: #EE6A61;
    --water: #7B98FF;
    --wa: #3DDC84;
    --li: #71AEEA;
  }
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0C1318;
  --panel: #121B21;
  --ink: #E5EBEE;
  --muted: #93A3AD;
  --rule: #2A3A44;
  --heat: #EE6A61;
  --water: #7B98FF;
  --wa: #3DDC84;
  --li: #71AEEA;
}
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--water); outline-offset: 3px; }
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }

/* header */
.top { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; flex-wrap: wrap; padding: 1.4rem 0; border-bottom: 1px solid var(--rule); }
.top .name { font-family: var(--display); font-weight: 600; font-size: 1.5rem; letter-spacing: .01em; text-decoration: none; }
.top nav { display: flex; gap: 1.6rem; flex-wrap: wrap; }
.top nav a { text-decoration: none; color: var(--muted); font-size: .95rem; padding: .2rem 0; border-bottom: 2px solid transparent; }
.top nav a:hover { color: var(--ink); border-color: var(--ink); }
.top nav { margin-left: auto; }
.theme-btn { align-self: center; display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; padding: 0; border: 1px solid var(--rule); background: var(--panel); color: var(--ink); cursor: pointer; }
.theme-btn:hover { border-color: var(--ink); }
@media (max-width: 640px) {
  .top nav { order: 2; flex-basis: 100%; margin-left: 0; }
  .theme-btn { margin-left: auto; }
}
.theme-btn .ico { width: 1.2rem; height: 1.2rem; grid-area: 1 / 1; }
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}

/* hero */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
h1 { font-family: var(--display); font-weight: 600; font-size: clamp(3.4rem, 11vw, 8.6rem); line-height: .92; letter-spacing: -.005em; margin: 0; max-width: 12ch; }
.hero-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); margin-top: clamp(1.5rem, 4vw, 2.75rem); align-items: start; }
.lede { font-size: 1.2rem; line-height: 1.55; margin: 0; max-width: 34em; }
.facts { margin: 0; border-top: 1px solid var(--ink); }
.facts div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--rule); font-size: .95rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* profile photo */
.portrait { width: min(100%, 210px); aspect-ratio: 4 / 5; margin: 0 0 1.25rem; border: 1px solid var(--ink); background: var(--panel); overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }

/* contact buttons */
.btns { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.5rem; }
.btn { display: inline-flex; align-items: center; gap: .6rem; padding: .7rem 1.1rem; border: 1px solid var(--ink); background: var(--panel); color: var(--ink); text-decoration: none; font-weight: 500; font-size: .98rem; }
.btn:hover { background: var(--ink); color: var(--bg); }
.btn .ico { width: 1.35rem; height: 1.35rem; flex: none; }
.btn .wa { color: var(--wa); }
.btn .li { color: var(--li); }
.btn:hover .ico { color: inherit; }
.btn-cv { background: var(--ink); color: var(--bg); gap: .8rem; padding: .55rem 1.2rem .55rem 1rem; }
.btn-cv:hover { background: var(--water); border-color: var(--water); color: #fff; }
.btn-cv .ico { width: 1.5rem; height: 1.5rem; transition: transform .2s ease; }
.btn-cv:hover .ico { transform: translateY(2px); }
.btn-cv .cv-text { display: flex; flex-direction: column; line-height: 1.25; }
.btn-cv .cv-title { font-weight: 600; }
.btn-cv small { font-size: .75rem; font-weight: 400; opacity: .8; letter-spacing: .02em; }
@media (prefers-reduced-motion: reduce) { .btn-cv .ico { transition: none; } .btn-cv:hover .ico { transform: none; } }

/* figures */
.shot { margin: 0; }
.shot button { display: block; width: 100%; padding: 0; border: 1px solid var(--ink); background: var(--shot); cursor: zoom-in; line-height: 0; }
.shot img { width: 100%; height: auto; }
.shot figcaption { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0 0; font-size: .85rem; color: var(--muted); line-height: 1.4; }
.shot figcaption b { color: var(--ink); font-weight: 500; }

/* sections */
section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid var(--ink); }
h2 { font-family: var(--display); font-weight: 600; font-size: clamp(2.1rem, 5vw, 3.3rem); line-height: 1; margin: 0 0 1.75rem; }
.sheet { --tone: var(--heat); }
.sheet.water { --tone: var(--water); }
.sheet-head { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; margin-bottom: 1.75rem; }
.sheet-head h3 { font-family: var(--display); font-weight: 600; font-size: clamp(1.9rem, 4.2vw, 2.9rem); line-height: 1.02; margin: 0 0 .9rem; padding-left: .85rem; border-left: 6px solid var(--tone); }
.sheet-head p { margin: 0; max-width: 36em; color: var(--ink); }
.block { margin: 0; border: 1px solid var(--ink); background: var(--panel); font-size: .9rem; }
.block div { display: grid; grid-template-columns: 6rem 1fr; }
.block div + div { border-top: 1px solid var(--rule); }
.block dt, .block dd { margin: 0; padding: .5rem .7rem; }
.block dt { color: var(--muted); border-right: 1px solid var(--rule); }
.figs { display: grid; gap: 1rem; }
.figs .sub { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.sheet + .sheet { margin-top: clamp(3rem, 7vw, 5.5rem); }

.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); }
.cols h3, .two h3 { font-family: var(--display); font-weight: 600; font-size: 1.6rem; margin: 0 0 .6rem; padding-bottom: .5rem; border-bottom: 1px solid var(--ink); }
.cols ul { list-style: none; margin: 0; padding: 0; }
.cols li { padding: .45rem 0; border-bottom: 1px solid var(--rule); font-size: .97rem; }
.cols li small { display: block; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); }
.entry { padding: .7rem 0; border-bottom: 1px solid var(--rule); }
.entry strong { font-weight: 600; display: block; }
.entry span { color: var(--muted); font-size: .93rem; }
.entry p { margin: .3rem 0 0; font-size: .93rem; line-height: 1.5; }
.two h3 + .entry { padding-top: .2rem; }
.two .sub-h { margin-top: 2rem; }

.contact p { font-size: 1.2rem; max-width: 30em; margin: 0 0 1.5rem; }
.contact .btns { margin-top: 0; }
.contact .direct { font-size: 1.05rem; margin: 1.5rem 0 0; line-height: 1.8; }
.contact .direct a { font-weight: 500; }
footer { padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .85rem; }

/* lightbox */
dialog { width: min(96vw, 1300px); max-height: 94vh; padding: 0; border: 1px solid var(--ink); background: #000; color: #fff; }
dialog::backdrop { background: rgba(0,0,0,.8); }
dialog img { width: 100%; height: auto; max-height: 86vh; object-fit: contain; }
dialog form { margin: 0; }
dialog .bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem .8rem; font-size: .9rem; background: #111; }
dialog button { font: inherit; color: #fff; background: transparent; border: 1px solid #fff; padding: .3rem .8rem; cursor: pointer; }

@media (max-width: 820px) {
  .hero-row, .sheet-head, .two, .cols { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 6.5rem 1fr; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
