/* =========================================================================
   Kazem Moussa — Mechanical Design Engineer
   Plastic Parts & Mould Design
   ========================================================================= */

/* ---------- Tokens ------------------------------------------------------ */

:root {
  /* Layered charcoal surfaces — no pure white anywhere. */
  --ink:          #090d12;
  --paper:        #0f151c;

  --text:         #e8edf3;
  --text-2:       #aeb9c5;
  --text-dim:     #8794a2;

  --accent:       #6ba3f0;
  --accent-2:     #8dbcf8;
  --accent-soft:  rgba(107, 163, 240, .10);

  --line:         rgba(255, 255, 255, .10);
  --line-2:       rgba(255, 255, 255, .055);
  --line-strong:  rgba(255, 255, 255, .30);

  --shell:        1240px;
  --gutter:       clamp(1.25rem, 4vw, 3.5rem);
  --radius:       3px;
  --nav-h:        76px;

  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset ------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, .97rem + .16vw, 1.075rem);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--ink); }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: .65rem 1rem;
  background: var(--accent);
  color: var(--ink);
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip-link:focus-visible { transform: none; }

/* ---------- Primitives -------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 500;
}

.label {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--mono);
  font-size: .715rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-dim);
}
.label__tick {
  width: 26px;
  height: 1px;
  background: var(--accent);
}

.btn {
  --btn-pad-y: .82rem;
  --btn-pad-x: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .015em;
  white-space: nowrap;
  transition: background-color .25s var(--ease), border-color .25s var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: var(--ink);
  border: 1px solid var(--accent);
}
.btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

/* ---------- Header ------------------------------------------------------ */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  color: var(--text);
  transition: background-color .35s var(--ease), backdrop-filter .35s var(--ease);
}
.site-header.is-stuck {
  background: rgba(9, 13, 18, .82);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line-2);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: var(--nav-h);
}

.brand { display: inline-flex; align-items: center; gap: .75rem; }
.brand__mark {
  width: 30px;
  height: 30px;
  color: var(--accent-2);
  flex: none;
}
.brand__mark svg { width: 100%; height: 100%; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-weight: 600; font-size: .98rem; letter-spacing: -.01em; }
.brand__role {
  font-family: var(--mono);
  font-size: .585rem;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ---------- Hero -------------------------------------------------------- */

.hero {
  position: relative;
  background: var(--ink);
  overflow: hidden;
  padding-top: calc(var(--nav-h) + clamp(1.5rem, 4vh, 3rem));
  padding-bottom: clamp(1.5rem, 3.5vh, 2.75rem);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero__grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 74px 74px;
  mask-image: radial-gradient(120% 90% at 20% 15%, #000 15%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 20% 15%, #000 15%, transparent 78%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  flex: 1;
}

.hero__title {
  font-size: clamp(2.2rem, 1.15rem + 3.9vw, 4.05rem);
  line-height: 1.06;
  letter-spacing: -.033em;
  font-weight: 700;
  text-wrap: balance;
}
.hero__title em {
  font-style: normal;
  color: var(--accent-2);
  position: relative;
}
.hero__title em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: .06em;
  height: 2px;
  background: currentColor;
  opacity: .3;
}

.hero__lede {
  margin-top: clamp(.85rem, 2vh, 1.4rem);
  max-width: 34em;
  color: var(--text-2);
  font-size: clamp(1rem, .95rem + .25vw, 1.135rem);
  line-height: 1.72;
}
.hero__lede strong { color: var(--text); font-weight: 600; }

.hero__actions {
  margin-top: clamp(1.15rem, 3vh, 2rem);
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
}

.hero__tags {
  margin-top: clamp(1rem, 2.6vh, 1.9rem);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.hero__tags li {
  padding: .38rem .8rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.hero__visual { position: relative; }
.hero__visual::before {
  content: "";
  position: absolute;
  inset: -12% -6%;
  background: radial-gradient(closest-side, rgba(107, 163, 240, .10), transparent 72%);
  pointer-events: none;
}

/* Optically centre the figure against the headline block. */
@media (min-width: 981px) {
  .hero__visual { transform: translateY(-44px); }
}

/* Short laptop viewports: keep the whole hero on one screen. */
@media (min-width: 981px) and (max-height: 800px) {
  .hero__title { font-size: clamp(1.95rem, 1rem + 2.7vw, 3.1rem); }
  .hero__lede  { font-size: 1rem; line-height: 1.65; }
  .hero__visual { transform: translateY(-28px); }
}

.hero__foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: clamp(.9rem, 2.4vh, 2.25rem);
  color: var(--text-dim);
}
.hero__foot-line { flex: 1; height: 1px; background: var(--line); }
.hero__mail {
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: .08em;
  transition: color .25s var(--ease);
}
.hero__mail:hover { color: var(--accent-2); }

/* ---------- Hero figure ------------------------------------------------- */

.figure { width: 100%; height: auto; max-height: 58svh; color: var(--text-dim); }
.figure text {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  fill: var(--text-dim);
  stroke: none;
}
.fig-text--dim { font-size: 9px; opacity: .55; }

.fig-ticks       { stroke: rgba(255, 255, 255, .26); stroke-width: 1; }

/* 3D box container */
.box-shadow      { fill: url(#box-shadow); stroke: none; }
.box-face        { stroke: rgba(255, 255, 255, .16); stroke-width: 1; }
.box-inner-face  { stroke: none; }
.box-rim         { stroke: none; }
.box-edge        { stroke: rgba(255, 255, 255, .42); stroke-width: 1.2; }
.box-edge-inner  { stroke: rgba(255, 255, 255, .3); stroke-width: 1; }
.box-edge-soft   { stroke: rgba(255, 255, 255, .18); stroke-width: 1; }
.box-rib         { fill: rgba(255, 255, 255, .045); stroke: rgba(255, 255, 255, .13); stroke-width: .8; }
.box-rib-hi      { stroke: rgba(255, 255, 255, .2); stroke-width: .8; }
.box-panel       { stroke: rgba(255, 255, 255, .2); stroke-width: 1; fill: rgba(0, 0, 0, .16); }
.box-panel-inner { stroke: rgba(255, 255, 255, .1); stroke-width: .8; }
.box-lip         { stroke: rgba(255, 255, 255, .26); stroke-width: 1; }
.box-sheen       { stroke: none; }

.fig-dim         { stroke: rgba(255, 255, 255, .34); stroke-width: 1; }
.fig-dim-line    { stroke: var(--accent); opacity: .85; }
.fig-leader      { stroke: rgba(255, 255, 255, .28); stroke-width: 1; stroke-dasharray: 3 4; }
.fig-node        { fill: var(--accent); stroke: none; }

.fig-assembly { transform-origin: 366px 300px; }
.js .fig-assembly { animation: fig-breathe 14s var(--ease) infinite; }

@keyframes fig-breathe {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-8px) scale(1.012); }
}

/* ---------- Responsive -------------------------------------------------- */

@media (max-width: 980px) {
  .hero { min-height: 0; padding-bottom: clamp(2.5rem, 6vh, 4rem); }
  .hero__inner { grid-template-columns: minmax(0, 1fr); gap: 3rem; }
  .hero__visual { max-width: 420px; margin-inline: auto; width: 100%; }
  .hero__foot { flex-wrap: wrap; gap: .75rem 1.25rem; }
  .hero__foot-line { display: none; }
}

@media (max-width: 760px) {
  :root { --nav-h: 66px; }

  .hero__visual { max-width: 340px; }
  .hero__actions { width: 100%; }
  .hero__actions .btn { width: 100%; }
}

@media (max-width: 420px) {
  .brand__role { display: none; }
}

/* ---------- Motion & print --------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media print {
  .site-header, .hero__grid-bg { display: none; }
  body { background: #fff; color: #000; }
}
