/* mertdemirdoven.me
   One family (Archivo) on its width axis: expanded for names and headings,
   normal for reading, condensed for facts and labels. */

:root {
  --paper: #f3f5f7;
  --surface: #ffffff;
  --ink: #0f1d2c;
  --ink-2: #4a5868;
  --rule: #d6dde4;
  --accent: #05707a;
  --accent-ink: #ffffff;
  --shot-bg: #e6ebf0;
  --field-border: #7f8c9a;
  --bezel: #0f1d2c;
  --focus: #05707a;

  --wide: 125%;
  --narrow: 87.5%;
  --measure: 62ch;
  --page: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 10px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0c1621;
    --surface: #111f2e;
    --ink: #e5ebf1;
    --ink-2: #9aa9b9;
    --rule: #223447;
    --accent: #4fd2da;
    --accent-ink: #052126;
    --shot-bg: #16283a;
    --field-border: #5d7187;
    --bezel: #2b3f55;
    --focus: #4fd2da;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #0c1621;
  --surface: #111f2e;
  --ink: #e5ebf1;
  --ink-2: #9aa9b9;
  --rule: #223447;
  --accent: #4fd2da;
  --accent-ink: #052126;
  --shot-bg: #16283a;
  --field-border: #5d7187;
  --bezel: #2b3f55;
  --focus: #4fd2da;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.6;
  font-stretch: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  z-index: 10;
}
.skip:focus { top: 12px; }

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}

.brand {
  font-stretch: var(--wide);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 22px;
  font-size: 16px;
}
.site-nav a { text-decoration: none; color: var(--ink-2); }
.site-nav a:hover { color: var(--ink); }

.tools { display: flex; align-items: center; gap: 6px; }

.lang,
.theme-toggle {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  font-stretch: var(--narrow);
  text-decoration: none;
  cursor: pointer;
}
.lang:hover,
.theme-toggle:hover { border-color: var(--ink-2); color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

@media (max-width: 720px) {
  .site-nav { display: none; }
}

/* ---------- hero ---------- */

.hero { padding: clamp(48px, 9vw, 112px) 0 clamp(56px, 8vw, 96px); }

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 12.4vw, 150px);
  font-weight: 800;
  font-stretch: var(--wide);
  line-height: 0.9;
  letter-spacing: -0.035em;
}
.hero h1 span { display: block; }

.lead {
  max-width: 34em;
  margin: 32px 0 0;
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.5;
  color: var(--ink-2);
}
.lead strong { color: var(--ink); font-weight: 600; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--accent); color: var(--accent-ink); }
.btn svg { width: 18px; height: 18px; }

.links-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
}

/* ---------- sections ---------- */

.section { padding: clamp(56px, 8vw, 104px) 0; border-top: 1px solid var(--rule); }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.section h2 {
  margin: 0;
  font-size: clamp(32px, 4.4vw, 48px);
  font-weight: 800;
  font-stretch: var(--wide);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.section-note {
  margin: 0;
  max-width: 36em;
  font-size: 16px;
  color: var(--ink-2);
}

/* ---------- projects ---------- */

.projects { display: grid; gap: clamp(56px, 8vw, 96px); }

.project {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px clamp(28px, 4vw, 56px);
  align-items: start;
}

.project h3 {
  margin: 0;
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 800;
  font-stretch: var(--wide);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.project .where {
  margin: 8px 0 0;
  font-size: 15px;
  font-stretch: var(--narrow);
  color: var(--ink-2);
}

.project .summary {
  margin: 18px 0 0;
  max-width: var(--measure);
}

.facts {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  line-height: 1.45;
}
.facts li {
  position: relative;
  padding: 9px 0 9px 22px;
  border-top: 1px solid var(--rule);
}
.facts li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 17px;
  width: 8px;
  height: 2px;
  background: var(--accent);
}
.facts b { font-weight: 600; }

.stack {
  margin: 18px 0 0;
  font-size: 15px;
  font-stretch: var(--narrow);
  color: var(--ink-2);
  line-height: 1.5;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  font-weight: 600;
}

.shot {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--shot-bg);
}
.shot img { width: 100%; }

.shot.is-phone {
  max-width: 300px;
  margin-inline: auto;
  border-radius: 34px;
  border-width: 8px;
  border-color: var(--bezel);
}

.phones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2.5vw, 28px);
  max-width: 560px;
  margin-inline: auto;
}
.phones .shot.is-phone { max-width: none; margin: 0; border-width: 6px; border-radius: 28px; }

.shot.is-render {
  border: 0;
  background: transparent;
  padding: 0 4%;
}

.shot figcaption {
  padding: 10px 14px;
  border-top: 1px solid var(--rule);
  background: var(--surface);
  font-size: 14px;
  font-stretch: var(--narrow);
  color: var(--ink-2);
}
.shot.is-render figcaption { border: 0; background: transparent; padding-inline: 0; text-align: center; }

@media (max-width: 900px) {
  .project { grid-template-columns: minmax(0, 1fr); }
  .project .shot,
  .project .phones { order: -1; }
}

/* smaller tools */

.minor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(24px, 3vw, 40px);
  margin: clamp(64px, 9vw, 112px) 0 0;
  padding: 0;
  list-style: none;
}
.minor-title {
  margin: clamp(64px, 9vw, 112px) 0 0;
  font-size: 22px;
  font-weight: 700;
  font-stretch: var(--wide);
  letter-spacing: -0.01em;
}
.minor-title + .minor { margin-top: 20px; }
.minor > li { padding: 20px 0 0; border-top: 2px solid var(--ink); }
.minor h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  font-stretch: var(--wide);
  letter-spacing: -0.01em;
}
.minor p:not(.stack):not(.terminal) { margin: 10px 0 0; font-size: 16px; line-height: 1.5; }
.minor .stack { margin-top: 10px; }
.minor .project-links { margin-top: 12px; }

.terminal {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: #0f1d2c;
  color: #c9d4de;
  font-size: 13px;
  font-stretch: var(--narrow);
  line-height: 1.4;
}
:root[data-theme="dark"] .terminal { background: #07101a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .terminal { background: #07101a; } }
.terminal .ok { color: #7bd88f; }
.terminal .nw { white-space: nowrap; }

@media (max-width: 900px) {
  .minor { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

/* ---------- experience ---------- */

.timeline { margin: 0; padding: 0; list-style: none; }

.timeline > li {
  display: grid;
  grid-template-columns: minmax(150px, 2fr) minmax(0, 7fr);
  gap: 8px clamp(24px, 4vw, 56px);
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}
.timeline > li:first-child { border-top: 0; padding-top: 0; }

.when {
  font-size: 16px;
  font-stretch: var(--narrow);
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.6;
}

.timeline h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  font-stretch: var(--wide);
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.timeline .org { margin: 6px 0 0; font-size: 16px; color: var(--ink-2); }
.timeline p { max-width: var(--measure); margin: 14px 0 0; }
.timeline ul { max-width: var(--measure); margin: 12px 0 0; padding-left: 20px; }
.timeline ul li { margin: 6px 0; }

@media (max-width: 640px) {
  .timeline > li { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- tech ---------- */

.tech {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(24px, 4vw, 56px);
  margin: 0;
}
.tech div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 4px 16px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.tech dt {
  font-size: 15px;
  font-stretch: var(--narrow);
  font-weight: 600;
  color: var(--ink-2);
  padding-top: 2px;
}
.tech dd { margin: 0; font-size: 17px; }

@media (max-width: 760px) {
  .tech { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .tech div { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 48px clamp(32px, 5vw, 72px);
  align-items: start;
}

.mail {
  display: inline-block;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
  font-stretch: var(--wide);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.contact-note { max-width: 30em; margin: 16px 0 0; color: var(--ink-2); }

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
}

.form { display: grid; gap: 16px; }
.form .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 15px; font-weight: 600; font-stretch: var(--narrow); color: var(--ink-2); }
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--field-border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus-visible,
.field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  font-size: 16px;
  color: var(--ink);
}

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .form .row { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- footer ---------- */

.site-footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--rule);
  font-size: 15px;
  color: var(--ink-2);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.site-footer p { margin: 0; }

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