/* FAZLI DB */

/* Fonts (SIL Open Font License 1.1, see fonts/) */

@font-face {
  font-family: "Press Start 2P";
  src: url("../fonts/PressStart2P-Regular.woff") format("woff");
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Regular.woff") format("woff");
  font-display: swap;
}

:root {
  --bg: #000;
  --panel: #0b191b;
  --cyan: #65dce6;
  --cyan-dark: #377f87;
  --white: #f3f5f5;
  --muted: #a1aaad;
  --line: #244247;
  --amber: #ffb000;

  --pixel: "Press Start 2P", monospace;
  --body: "IBM Plex Mono", "Courier New", monospace;
}

/* Base */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

h2 {
  font-weight: 400;
}

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 6px;
}

::selection {
  background: var(--cyan);
  color: #000;
}

.container {
  width: min(100% - 64px, 1470px);
  margin-inline: auto;
}

/* Shared pieces */

.micro {
  font-family: var(--pixel);
  font-size: 12px;
  line-height: 2;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.accent {
  color: var(--cyan);
}

.info-panel {
  position: relative;
  padding: 48px 60px 60px;
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 6px 6px 0 var(--line);
}

.question {
  max-width: 1160px;
}

.question + .question {
  margin-top: 46px;
}

.question h2 {
  margin: 0 0 30px;
  font-size: 42px;
  letter-spacing: -0.7px;
}

.question p {
  margin: 0;
}

/* Pixel art: keep the hard edges when scaled */
.computer-art,
.disk-art,
.robot-art,
.os-icons img {
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Header */

.site-header {
  border-bottom: 2px solid var(--line);
}

.header-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
  font-size: 30px;
  letter-spacing: -0.8px;
  color: #fff;
}

.brand-image {
  display: block;
  flex: 0 0 auto;
  width: 92px;
  height: 40px;
  object-fit: contain;
}

.navigation {
  display: flex;
  gap: 32px;
  color: var(--muted);
  font-size: 16px;
}

.navigation a {
  padding-block: 14px;
  transition: color 0.2s ease;
}

.navigation a:hover {
  color: var(--cyan);
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 64px;
  padding: 145px 60px 165px;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 4.7vw, 78px);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -1.8px;
}

h1 span {
  display: block;
  margin-top: 18px;
  color: var(--cyan);
}

.hero .micro {
  max-width: 680px;
  margin: 28px 0 0;
}

.hero-art {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  transition: transform 0.3s ease;
}

.hero-image {
  display: block;
  flex: 0 0 auto;
  width: 125%;
  height: auto;
}

/* About */

.about .question:nth-child(2) {
  min-height: 170px;
  padding-right: 230px;
}

.computer-art {
  position: absolute;
  top: 44%;
  right: 54px;
  width: 200px;
  height: 200px;
}

/* "microwave" crossed out, "computer" written under it */
.word-correction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: top;
  margin-inline: 5px;
  line-height: 2;
  white-space: nowrap;
}

.word-correction del {
  position: relative;
  display: block;
  color: var(--cyan);
  text-decoration: none;
}

.word-correction del::after {
  content: "";
  position: absolute;
  top: 47%;
  left: -5%;
  width: 110%;
  height: 2px;
  background: var(--white);
  transform: rotate(-8deg);
}

.corrected-word {
  display: block;
  color: var(--cyan);
  font-size: 0.9em;
  letter-spacing: 1px;
}

/* Requirements and benchmark: big pixel lists */

.specifications {
  padding: 150px 66px 0;
}

.spec-group + .spec-group {
  margin-top: 145px;
}

.section-title {
  margin: 0 0 70px;
  font-size: clamp(38px, 4.2vw, 64px);
  line-height: 1.2;
  letter-spacing: -1px;
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 60px;
}

.spec-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--pixel);
  font-size: clamp(23px, 2.7vw, 40px);
  line-height: 1.9;
  letter-spacing: 2px;
  color: var(--cyan);
}

.spec-list li {
  white-space: nowrap;
}

.spec-caption {
  margin: 18px 0 0;
  text-align: center;
}

.disk-art {
  justify-self: center;
  width: 185px;
  height: 185px;
}

.os-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
}

.os-icons img {
  width: 92px;
  height: 104px;
}

/* Current progress */

.progress {
  margin-top: 150px;
}

/* Benchmark chart (built by js/main.js) */

.bench-figure {
  width: 100%;
  max-width: 760px;
  min-width: 0;
  margin: 0;
  color: var(--white);
}

.bench-plot {
  position: relative;
  padding: 34px 0 30px 52px;
}

.bench-canvas {
  position: relative;
}

.bench-chart {
  display: block;
  width: 100%;
  height: auto;
  shape-rendering: crispEdges;
}

.bench-grid { fill: var(--line); }
.bench-axis { fill: var(--muted); }
.bench-slow { fill: currentColor; }
.bench-fast { fill: var(--cyan); }

.bench-y,
.bench-tag,
.bench-x span {
  position: absolute;
  font-family: var(--pixel);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 1px;
  color: var(--muted);
  white-space: nowrap;
}

.bench-y {
  right: calc(100% + 12px);
  transform: translateY(-50%);
}

.bench-tag {
  top: 6px;
  margin-left: 52px;
  color: var(--white);
}

.bench-tag.is-fast { color: var(--cyan); }
.bench-tag.is-last { margin-left: 0; }
.bench-tag.is-waiting { visibility: hidden; }

.bench-x {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 52px;
  height: 18px;
}

.bench-x span {
  bottom: 0;
  transform: translateX(-50%);
}

.bench-caption {
  margin: 18px 0 0;
  text-align: center;
}

/* The chart goes under the list once the two stop fitting side by side */
@media (max-width: 1250px) {
  .benchmark .spec-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 50px;
  }

  .benchmark .spec-caption {
    text-align: left;
  }
}

/* Results */

.results-list li {
  white-space: normal;
}

.results-list .amber {
  color: var(--amber);
}

.test-machines {
  margin: 18px 0 0;
}

/* Contact */

.contact {
  display: flex;
  flex-direction: column;
  gap: 56px;
  margin: 150px 0 140px;
  padding: 48px 60px 72px;
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 6px 6px 0 var(--line);
}

.contact-title {
  align-self: flex-start;
  margin: 0;
  font-size: 42px;
  line-height: 1.2;
  letter-spacing: -0.7px;
}

.contact-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.contact-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: min(100%, 462px);
  min-height: 90px;
  padding: 25px 35px;
  background: var(--cyan-dark);
  border: 2px solid var(--cyan);
  box-shadow: 5px 5px 0 #1b3f43;
  color: var(--white);
  font-size: clamp(25px, 2.5vw, 32px);
  text-align: center;
  transition:
    background 0.2s ease,
    transform 0.1s steps(2, end),
    box-shadow 0.1s steps(2, end);
}

.robot-art {
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  margin-right: 30px;
}

/* Footer */

.site-footer {
  padding: 30px 0 55px;
  border-top: 2px solid var(--line);
}

/* Contact dialog */

dialog {
  width: min(580px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 38px;
  color: var(--white);
  background: var(--panel);
  border: 2px solid var(--cyan);
  box-shadow: 8px 8px 0 var(--cyan-dark);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.close-button {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: #000;
  color: var(--white);
  font-size: 24px;
}

.modal-heading {
  margin: 0 0 14px;
  padding-right: 36px;
  font-family: var(--pixel);
  font-size: 17px;
  line-height: 1.8;
  color: var(--cyan);
}

.modal-description {
  margin: 0 0 28px;
  font-size: 18px;
  line-height: 1.6;
}

.modal-email {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}

.send-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 15px;
  background: var(--cyan);
  color: #000;
  font-family: var(--pixel);
  font-size: 12px;
  line-height: 1.6;
}

.other-mail {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.other-mail a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.other-mail span {
  margin-inline: 6px;
}

/* Hover: icons wobble in four frames, like old sprites */

@keyframes pixel-hover {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-4px) rotate(-2deg); }
  50% { transform: translateY(-7px) rotate(0); }
  75% { transform: translateY(-4px) rotate(2deg); }
}

@keyframes robot-greeting {
  0%, 100% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(-6px) rotate(-4deg); }
  70% { transform: translateY(-3px) rotate(4deg); }
}

@media (hover: hover) and (pointer: fine) {
  .hero-art:hover {
    transform: translateY(-5px);
  }

  .computer-art:hover,
  .disk-art:hover,
  .robot-art:hover,
  .os-icons img:hover {
    animation: pixel-hover 0.85s steps(4, end) infinite;
  }

  .contact-button:hover {
    background: #42949d;
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 #1b3f43;
  }

  .contact-button:hover + .robot-art {
    animation: robot-greeting 0.8s steps(4, end) infinite;
  }
}

/* Tablet */

@media (max-width: 1100px) {
  .hero { gap: 35px; padding-inline: 24px; }
  .micro { font-size: 10px; }
  .info-panel { padding: 40px; }
  .question h2,
  .contact-title { font-size: 36px; }
  .about .question:nth-child(2) { padding-right: 180px; }
  .computer-art { right: 35px; width: 160px; height: 160px; }
  .specifications { padding-inline: 35px; }
  .spec-list { font-size: clamp(21px, 2.7vw, 30px); letter-spacing: 1px; }
  .os-icons { gap: 20px; }
  .os-icons img { width: 70px; height: 80px; }
  .contact { padding: 40px 40px 64px; }
}

/* Small tablet */

@media (max-width: 800px) {
  .container { width: calc(100% - 40px); }
  .header-inner { min-height: 76px; }
  .brand { font-size: 25px; }
  .brand-image { width: 76px; height: 33px; }
  .navigation { gap: 16px; font-size: 14px; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 45px;
    padding: 85px 15px 95px;
  }

  h1 { font-size: clamp(40px, 7vw, 64px); }
  .hero-art { justify-content: flex-start; }
  .hero-image { width: min(100%, 640px); }

  .info-panel { padding: 32px; }
  .progress { margin-top: 110px; }
  .specifications { padding: 95px 20px 0; }
  .spec-row { gap: 25px; }
  .spec-list { font-size: clamp(18px, 3vw, 25px); }
  .disk-art { width: 145px; height: 145px; }
  .os-icons { gap: 14px; }
  .os-icons img { width: 54px; height: 64px; }

  .contact {
    gap: 40px;
    margin: 110px 0 100px;
    padding: 32px 32px 48px;
  }

  .contact-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }

  .robot-art {
    align-self: flex-end;
    width: 90px;
    height: 90px;
    margin-right: 0;
  }
}

/* Phone */

@media (max-width: 600px) {
  .container { width: calc(100% - 32px); }
  .header-inner { min-height: 68px; }
  .brand { gap: 10px; font-size: 22px; }
  .brand-image { width: 64px; height: 28px; }
  .navigation { display: none; }

  .hero { gap: 40px; padding: 65px 5px; }
  h1 { font-size: clamp(32px, 8.5vw, 47px); letter-spacing: -1px; }

  .micro { font-size: 10px; line-height: 2.1; letter-spacing: 1px; }
  .info-panel { padding: 27px 21px; }
  .question + .question { margin-top: 36px; }
  .question h2 { margin-bottom: 20px; font-size: 28px; }

  .about .question:nth-child(2) { min-height: 0; padding-right: 0; }

  .computer-art {
    position: static;
    width: 110px;
    height: 110px;
    margin: 26px 0 0 auto;
  }

  .progress { margin-top: 85px; }
  .specifications { padding: 75px 5px 0; }
  .spec-group + .spec-group { margin-top: 75px; }
  .section-title { margin-bottom: 35px; font-size: 34px; }

  .spec-row { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .spec-list { font-size: clamp(15px, 4.3vw, 23px); line-height: 2; letter-spacing: 1px; }
  .spec-caption { text-align: left; }
  .disk-art { justify-self: start; width: 110px; height: 110px; }
  .os-icons { justify-content: flex-start; gap: 26px; }
  .os-icons img { width: 58px; height: 68px; }

  .bench-plot { padding: 28px 0 26px 38px; }
  .bench-y,
  .bench-tag,
  .bench-x span { font-size: 9px; letter-spacing: 0.5px; }
  .bench-tag { margin-left: 38px; }
  .bench-x { left: 38px; }
  .bench-caption { text-align: left; }

  .contact { gap: 32px; margin: 85px 0; padding: 27px 21px 32px; }
  .contact-title { font-size: 28px; }

  .contact-button {
    width: 100%;
    min-height: 76px;
    padding: 20px 22px;
    font-size: 22px;
  }

  dialog { padding: 28px 20px; }
  .modal-heading { font-size: 14px; }
}

/* Very narrow phones */

@media (max-width: 360px) {
  h1 { font-size: 28px; }
  .bench-y,
  .bench-tag,
  .bench-x span { letter-spacing: 0; }
  .bench-tag[data-name="mongo-db"] { transform: translateX(-20px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .hero-art,
  .contact-button {
    transform: none !important;
  }
}
