/* Daniel Özdek – oezdek.com
   System fonts only (no font CDN). The visual language is an engineering one:
   dot-grid paper, readouts, schematics with signal-coloured wires. */

:root {
  --bg: #f5f5f7;
  --paper: #ffffff;
  --sunken: #f0f0f3;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --line: #d2d2d7;
  --hair: rgba(0, 0, 0, 0.08);
  --link: #1d1d1f;
  --accent: #1d1d1f;
  --on-accent: #ffffff;
  --signal: #b25000;
  --signal-strong: #d9690a;
  --dot-lit: rgba(217, 105, 10, 0.75);
  --dot: rgba(0, 0, 0, 0.13);
  --bezel: #1d1d1f;
  --window-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.14), 0 24px 60px -16px rgba(0, 0, 0, 0.28), 0 6px 16px -6px rgba(0, 0, 0, 0.12);
  --bar-bg: rgba(245, 245, 247, 0.8);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1152px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --paper: #1c1c1e;
    --sunken: #161618;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --line: #3a3a3c;
    --hair: rgba(255, 255, 255, 0.1);
    --link: #f5f5f7;
    --accent: #f5f5f7;
    --on-accent: #000000;
    --signal: #ff9f0a;
    --signal-strong: #ffb340;
    --dot-lit: rgba(255, 159, 10, 0.85);
    --dot: rgba(255, 255, 255, 0.13);
    --bezel: #2c2c2e;
    --window-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.16), 0 24px 60px -16px rgba(0, 0, 0, 0.9);
    --bar-bg: rgba(0, 0, 0, 0.72);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  position: relative;
  isolation: isolate;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

img { display: block; max-width: 100%; height: auto; }

/* Engineering paper behind the whole page. Around the pointer the dots light up
   in the signal colour, like a probe moving over a board. */
body::before, body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.5px);
  background-size: 22px 22px;
  background-position: 11px 11px;
}
body::after {
  background-image: radial-gradient(var(--dot-lit) 1.5px, transparent 1.8px);
  -webkit-mask-image: radial-gradient(180px circle at var(--mx, -500px) var(--my, -500px), #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 100%);
  mask-image: radial-gradient(180px circle at var(--mx, -500px) var(--my, -500px), #000 0%, rgba(0, 0, 0, 0.35) 45%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s;
}
body.probe::after { opacity: 1; }
p, h1, h2, h3, dl, dd, figure { margin: 0; }

a { color: var(--link); text-decoration: underline; text-decoration-color: var(--signal); text-decoration-thickness: 1.5px; text-underline-offset: 0.22em; }
a:hover { color: var(--signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--display); text-wrap: balance; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 10;
  background: var(--paper);
  padding: 8px 14px;
  border-radius: 8px;
}
.skip:focus { top: 12px; }

/* Top bar */
.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bar-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--hair);
}
.bar-inner {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 56px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.bar-nav { display: flex; gap: 24px; }
.bar-nav a, .lang { color: var(--ink); font-size: 0.875rem; opacity: 0.8; text-decoration: none; }
.bar-nav a:hover, .lang:hover { opacity: 1; color: var(--signal); }
.lang {
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 7px;
}

/* Hero: the name is the headline; one line types what Daniel builds */
.hero {
  position: relative;
  padding-top: clamp(40px, 7vw, 96px);
  padding-bottom: clamp(56px, 8vw, 112px);
}
.hero > .wrap { position: relative; }
.name {
  font-size: clamp(4rem, 1rem + 13.5vw, 12.5rem);
  line-height: 0.88;
  font-weight: 800;
  letter-spacing: -0.055em;
  margin-left: -0.04em;
  text-wrap: initial;
}
.typeline {
  margin-top: clamp(20px, 3vw, 36px);
  font-family: var(--mono);
  font-size: clamp(1rem, 0.8rem + 1.1vw, 1.625rem);
  line-height: 1.4;
  letter-spacing: -0.02em;
  min-height: 2.8em;
}
.prompt { color: var(--signal); font-weight: 700; }
.typed { color: var(--ink); }
.caret {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.18em;
  background: var(--signal);
}
@media (prefers-reduced-motion: no-preference) {
  .caret { animation: blink 1.06s steps(1) infinite; }
}
@keyframes blink { 50% { opacity: 0; } }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hero-row {
  margin-top: clamp(28px, 4vw, 48px);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 48px;
}
.lead {
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 36em;
  letter-spacing: -0.014em;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Stack as a readout strip, like the value rows on a measuring device */
.readout {
  margin-top: clamp(40px, 6vw, 72px);
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
}
.readout div { padding: 14px 16px 0 0; }
.readout div + div { padding-left: 16px; border-left: 0.5px solid var(--line); }
.readout dt { font-family: var(--mono); font-size: 0.75rem; color: var(--signal); }
.readout dd { margin-top: 6px; font-size: 0.9375rem; line-height: 1.45; }
.readout div:first-child dd { font-weight: 600; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: 1.5px solid var(--ink);
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
/* the small square is the "signal" LED of the key */
.btn::before { content: ""; width: 7px; height: 7px; border-radius: 1px; background: currentColor; opacity: 0.35; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary::before { background: var(--signal-strong); opacity: 1; }
.btn-primary:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn-primary:hover::before { background: #fff; }
.btn-quiet { background: transparent; color: var(--ink); }
.btn-quiet:hover { border-color: var(--signal); color: var(--signal); }
.btn-large { min-height: 54px; padding: 0 26px; font-size: 1rem; }

/* About me: heading left, text middle, facts right */
.about {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 3fr);
  gap: clamp(24px, 4vw, 56px);
  padding-top: clamp(64px, 9vw, 120px);
  padding-bottom: clamp(64px, 9vw, 120px);
  align-items: start;
}
.about h2 { margin: 0; }
.about-text p { font-size: 1.125rem; line-height: 1.6; max-width: 36em; }
.about-text p + p { margin-top: 1em; }
.about-text p:first-child { font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem); line-height: 1.45; letter-spacing: -0.02em; font-weight: 500; }
.about-facts { border-top: 1px solid var(--ink); }
.about-facts div { padding: 12px 0; border-bottom: 0.5px solid var(--line); }
.about-facts dt { font-family: var(--mono); font-size: 0.75rem; color: var(--signal); }
.about-facts dd { margin-top: 3px; font-size: 0.9375rem; }

/* Terminal command above each section heading */
.cmd {
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--ink-2);
  margin-bottom: 14px;
}
.cmd .prompt { color: var(--signal); font-weight: 700; margin-right: 4px; }
.about .cmd { grid-column: 1 / -1; margin-bottom: -8px; }
/* beat the section paragraph rules (.section-head p, .contact p) */
.section-head .cmd, .contact .cmd { font-size: 0.875rem; color: var(--ink-2); margin: 0 0 14px; max-width: none; }

::selection { background: var(--signal); color: #fff; }

/* FAQ: native disclosure, styled like a man page */
.faq {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(24px, 4vw, 56px);
  padding-top: clamp(64px, 9vw, 120px);
  padding-bottom: clamp(64px, 9vw, 120px);
  align-items: start;
}
.faq h2 { margin: 0; }
.faq-list { border-top: 1px solid var(--ink); }
.faq details { border-bottom: 0.5px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 18px 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "›";
  font-family: var(--mono);
  font-weight: 700;
  color: var(--signal);
  display: inline-block;
  width: 0.8em;
  transition: transform 0.18s;
}
.faq details[open] summary::before { transform: rotate(90deg); }
.faq summary:hover { color: var(--signal); }
.faq details p { padding: 0 0 20px calc(0.8em + 14px); color: var(--ink-2); max-width: 40em; }
@media (prefers-reduced-motion: reduce) { .faq summary::before { transition: none; } }

.build { font-family: var(--mono); font-size: 0.75rem; margin-left: 6px; opacity: 0.8; }

/* Sections */
.section-head { padding-bottom: clamp(24px, 4vw, 48px); }
h2 {
  font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.5rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.section-head p { margin-top: 14px; font-size: 1.1875rem; color: var(--ink-2); max-width: 36em; }

/* Separators sit on the content width, not the gutter */
.rule {
  background-image: linear-gradient(var(--hair), var(--hair));
  background-repeat: no-repeat;
  background-size: min(var(--max), calc(100% - 2 * var(--gutter))) 1px;
  background-position: center top;
}
.projects { padding-top: clamp(64px, 9vw, 120px); }

/* A project reads like a datasheet: header line, copy + specs, media, schematic */
.project { padding-top: clamp(40px, 6vw, 72px); padding-bottom: clamp(48px, 7vw, 88px); }

.project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
}
.project-head h3 { font-size: clamp(1.75rem, 1.3rem + 1.5vw, 2.5rem); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.project-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.9375rem; color: var(--ink-2); }
.status { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }

.project-body {
  margin-top: clamp(24px, 3vw, 36px);
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.project-copy { padding-top: 8px; }
.project.flip .project-body { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.project.flip .project-media { order: -1; }
.project-copy > p { font-size: 1.0625rem; max-width: 36em; }
.project-links { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 24px; font-weight: 500; }

.specs { margin-top: 28px; border-top: 0.5px solid var(--line); }
.specs div {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-bottom: 0.5px solid var(--line);
  font-size: 0.9375rem;
}
.specs dt { color: var(--ink-2); }

.project-media { display: flex; justify-content: center; }

/* iPhone: screen corner radius is ~13.7 % of its width, the bezel adds a thin rim */
.phone {
  width: clamp(208px, 20vw, 256px);
  padding: 7px;
  border-radius: 44px;
  background: var(--bezel);
  box-shadow: 0 0 0 1px var(--hair), 0 30px 60px -28px rgba(0, 0, 0, 0.45);
}
.phone img { width: 100%; border-radius: 37px; }

.device-pair { display: flex; align-items: flex-start; gap: clamp(12px, 2vw, 24px); }
.device-pair .phone { width: clamp(150px, 15vw, 210px); }
.device-pair .phone.android { margin-top: 48px; }
/* Pixel: flatter corners and a thinner rim than the iPhone */
.phone.android { padding: 5px; border-radius: 30px; }
.phone.android img { border-radius: 25px; }

.table-window {
  width: 100%;
  max-width: 460px;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: inset 0 0 0 0.5px var(--line);
  overflow: hidden;
}
.mac-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.mac-table caption {
  caption-side: bottom;
  text-align: left;
  padding: 10px 14px 12px;
  color: var(--ink-2);
  font-size: 0.75rem;
  border-top: 0.5px solid var(--hair);
}
.mac-table th, .mac-table td { padding: 6px 14px; text-align: left; }
.mac-table thead th { font-weight: 600; color: var(--ink-2); font-size: 0.75rem; border-bottom: 0.5px solid var(--hair); }
.mac-table tbody th { font-weight: 600; font-family: var(--mono); font-size: 0.75rem; white-space: nowrap; }
.mac-table tbody td { color: var(--ink-2); }
.mac-table tbody tr:nth-child(even) { background: var(--sunken); }

/* ClipSound: the window screenshot gets the full width */
.project-wide .project-body { align-items: start; }
.project-wide .project-copy { padding-top: 0; }
.specs-grid { margin-top: 0; }
.mac-shot { margin: clamp(32px, 5vw, 56px) auto 0; max-width: 980px; }
.mac-shot img { width: 100%; border-radius: 12px; box-shadow: 0 0 0 0.5px var(--line), 0 24px 60px -24px rgba(0, 0, 0, 0.35); }

/* Schematic: how each app reaches its hardware. Labels come from the READMEs. */
.schematic {
  margin-top: clamp(32px, 5vw, 56px);
  padding: 22px clamp(16px, 3vw, 32px) 28px;
  border-radius: 14px;
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 14px 14px;
  background-position: 7px 7px;
  box-shadow: inset 0 0 0 0.5px var(--line);
}
.schematic figcaption { font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); margin-bottom: 20px; }
.chain { display: flex; align-items: center; justify-content: center; }
.node {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, 0.05);
}
.node-kind { font-size: 0.75rem; color: var(--ink-2); }
.node-title { font-size: 0.9375rem; font-weight: 600; }
.node-meta { font-family: var(--mono); font-size: 0.6875rem; color: var(--ink-2); }

.link {
  flex: 1 1 0;
  min-width: 96px;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 0 6px;
}
.link-name { text-align: center; font-size: 0.75rem; font-weight: 600; color: var(--ink); }
.wire {
  position: relative;
  height: 2px;
  margin: 0 7px;
  background: repeating-linear-gradient(90deg, var(--signal) 0 6px, transparent 6px 10px);
  background-size: 10px 2px;
}
.wire > span {
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-2);
  white-space: nowrap;
}
.wire.out + .wire.in { margin-top: 22px; }
.wire.in:only-of-type, .wire.out:only-of-type { margin-bottom: 0; }
.wire::after {
  content: "";
  position: absolute;
  top: -4px;
  border: 5px solid transparent;
}
.wire.out::after { right: -8px; border-left-color: var(--signal); }
.wire.in::after { left: -8px; border-right-color: var(--signal); }
.link:has(.wire > span:not(:empty)) { padding-bottom: 18px; }

/* Data keeps flowing along the wires while the schematic is on screen */
@media (prefers-reduced-motion: no-preference) {
  .schematic.is-live .wire.out { animation: flow-out 0.7s linear infinite; }
  .schematic.is-live .wire.in { animation: flow-in 0.7s linear infinite; }
}
@keyframes flow-out { to { background-position: 10px 0; } }
@keyframes flow-in { to { background-position: -10px 0; } }

/* How I work */
.work { padding-top: clamp(64px, 9vw, 120px); padding-bottom: clamp(64px, 9vw, 120px); }
.work-grid {
  margin-top: clamp(28px, 4vw, 48px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
}
.work-grid > div { border-top: 2px solid var(--ink); padding-top: 18px; }
.work-grid h3 { font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.015em; }
.work-grid p { margin-top: 8px; color: var(--ink-2); }

/* Contact */
.contact {
  padding-top: clamp(64px, 10vw, 136px);
  padding-bottom: clamp(64px, 10vw, 136px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.contact p { margin: 18px 0 32px; font-size: 1.1875rem; color: var(--ink-2); max-width: 32em; }

.foot {
  padding-top: 24px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.foot-links { display: flex; gap: 20px; }

/* Tablet */
@media (max-width: 960px) {
  .readout { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 20px; }
  .readout div:nth-child(4) { padding-left: 0; border-left: 0; }
  .project-body, .project.flip .project-body { grid-template-columns: 1fr; }
  .project.flip .project-media { order: 0; }
  .work-grid { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .faq { grid-template-columns: 1fr; }
}

/* Narrow screens: the schematic turns vertical, wires run downwards */
@media (max-width: 820px) {
  .chain { flex-direction: column; align-items: stretch; max-width: 440px; margin-inline: auto; }
  .node { align-self: stretch; }
  /* name above, wires side by side, outgoing label left, incoming label right */
  .link {
    flex-flow: row wrap;
    justify-content: center;
    align-items: center;
    max-width: none;
    min-width: 0;
    padding: 12px 0;
    gap: 6px 0;
  }
  .link-name { flex-basis: 100%; }
  .wire {
    width: 2px;
    height: 44px;
    margin: 0 9px;
    background: repeating-linear-gradient(180deg, var(--signal) 0 6px, transparent 6px 10px);
    background-size: 2px 10px;
  }
  .wire.out + .wire.in { margin-top: 0; }
  .wire > span { top: 50%; transform: translateY(-50%); }
  .wire.out > span { left: auto; right: calc(100% + 12px); text-align: right; }
  .wire.in > span { left: calc(100% + 12px); right: auto; text-align: left; }
  .wire.out::after { right: -4px; top: auto; bottom: -8px; border-color: transparent; border-top-color: var(--signal); }
  .wire.in::after { left: -4px; top: -8px; border-color: transparent; border-bottom-color: var(--signal); }
  .link:has(.wire > span:not(:empty)) { padding-bottom: 12px; }
  @media (prefers-reduced-motion: no-preference) {
    @keyframes flow-out { to { background-position: 0 10px; } }
    @keyframes flow-in { to { background-position: 0 -10px; } }
  }
}

/* Phone */
@media (max-width: 680px) {
  .bar-nav { display: none; }
  .bar-inner { height: 52px; }
  .name { line-height: 1; }
  .readout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .readout div:nth-child(n) { padding-left: 0; border-left: 0; }
  .readout div:nth-child(even) { padding-left: 16px; border-left: 0.5px solid var(--line); }
  .readout div:nth-child(4) { padding-left: 16px; border-left: 0.5px solid var(--line); }
  .specs div { grid-template-columns: 7rem minmax(0, 1fr); }
  .phone { border-radius: 44px; }
  .phone img { border-radius: 37px; }
}
