/* ==========================================================================
   abdullahturk.com — base stylesheet

   Two skins share one layout. This file is the "clean" skin: quiet editorial
   typography, one accent colour, plenty of air. css/y2k.css re-skins the exact
   same markup by overriding the tokens below and adding period ornaments, so
   nothing here should hard-code a colour outside :root.
   ========================================================================== */

/* --- reset ---------------------------------------------------------------- */

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

body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[class],
ol[class] {
  list-style: none;
  padding: 0;
}

img,
picture,
svg {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* --- tokens --------------------------------------------------------------- */

:root {
  --bg: #fbfaf7;
  --bg-sunk: #f2f0ea;
  --surface: #ffffff;
  --ink: #16161a;
  --ink-soft: #55555f;
  --ink-faint: #8a8a95;
  --rule: #e2dfd6;
  --accent: #2f4bff;
  --accent-ink: #ffffff;
  --accent-wash: #eaedff;
  --marker: #ffd84d;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 74rem;
  --measure: 40rem;

  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3rem);
  --step-4: clamp(2.6rem, 1.8rem + 4vw, 5rem);

  --gap: 1.25rem;
  --section: clamp(3.5rem, 8vw, 7rem);
  --radius: 4px;
  --shadow: 0 1px 2px rgb(20 20 30 / 0.05), 0 8px 24px -12px rgb(20 20 30 / 0.15);
  --speed: 180ms;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="y2k"]) {
    --bg: #101014;
    --bg-sunk: #17171d;
    --surface: #1a1a21;
    --ink: #f0efeb;
    --ink-soft: #b0afb8;
    --ink-faint: #7a7a86;
    --rule: #2c2c35;
    --accent: #8fa3ff;
    --accent-ink: #0d0d12;
    --accent-wash: #1e2140;
    --marker: #c9a63a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -12px rgb(0 0 0 / 0.7);
  }
}

/* --- base ----------------------------------------------------------------- */

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
}
h2 {
  font-size: var(--step-3);
}
h3 {
  font-size: var(--step-1);
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

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

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.measure {
  max-width: var(--measure);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  text-decoration: none;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--gap);
  min-height: 4.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-right: auto;
}

.brand__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.nav {
  display: flex;
  gap: 1.4rem;
}

.nav__link {
  text-decoration: none;
  font-size: 0.94rem;
  color: var(--ink-soft);
  padding-block: 0.35rem;
  border-bottom: 1.5px solid transparent;
  transition: color var(--speed), border-color var(--speed);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 1rem;
}

.lang {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.lang__btn {
  background: none;
  border: 0;
  padding: 0.3rem 0.5rem;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  cursor: pointer;
  transition: background var(--speed), color var(--speed);
}

.lang__btn + .lang__btn {
  border-left: 1px solid var(--rule);
}

.lang__btn:hover {
  color: var(--ink);
  background: var(--bg-sunk);
}

.lang__btn.is-active {
  background: var(--accent);
  color: var(--accent-ink);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.3rem 0.6rem;
  font-size: 0.76rem;
  color: var(--ink-faint);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--speed), border-color var(--speed);
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--ink-faint);
}

.theme-toggle__face {
  color: var(--accent);
}

.nav-toggle {
  display: none;
}

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

.hero {
  padding-block: clamp(3rem, 9vw, 7rem) var(--section);
  border-bottom: 1px solid var(--rule);
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 1.25rem;
}

.hero__name {
  margin-bottom: 0.5rem;
}

.hero__role {
  font-size: var(--step-1);
  color: var(--accent);
  font-family: var(--font-display);
  margin-bottom: 1.5rem;
}

.hero__blurb {
  font-size: var(--step-1);
  color: var(--ink-soft);
  line-height: 1.55;
  max-width: 46rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.25rem;
}

/* --- buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform var(--speed), background var(--speed), color var(--speed);
}

.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  transform: translateY(-1px);
}

.btn--ghost {
  background: none;
  color: var(--ink);
  border-color: var(--rule);
}

.btn--ghost:hover {
  background: none;
  color: var(--accent);
  border-color: var(--accent);
}

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

.section {
  padding-block: var(--section);
  border-bottom: 1px solid var(--rule);
}

.section:last-of-type {
  border-bottom: 0;
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap);
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.section__title {
  font-size: var(--step-2);
}

.section__intro {
  color: var(--ink-soft);
  max-width: var(--measure);
  margin-top: 0.75rem;
}

.section__link {
  font-size: 0.9rem;
  color: var(--accent);
}

/* --- "currently" list ----------------------------------------------------- */

.now {
  display: grid;
  gap: 0;
  counter-reset: now;
}

.now__item {
  display: flex;
  gap: 1.25rem;
  padding-block: 1.1rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
}

.now__item:last-child {
  border-bottom: 1px solid var(--rule);
}

.now__item::before {
  counter-increment: now;
  content: counter(now, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  padding-top: 0.35rem;
}

/* --- project cards -------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1.5rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform var(--speed), box-shadow var(--speed), border-color var(--speed);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--rule));
}

/* Cover art. It sits after the title in the markup so the OS skins can keep
   their title bar pinned to the top of the window; the clean skin pulls it
   above with `order`, which is the layout that actually reads best there. */
.card__cover {
  order: -1;
  width: calc(100% + 3.2rem);
  /* The reset's `img { max-width: 100% }` would clamp this back to the content
     box, letting the negative margins pull left but not right. */
  max-width: none;
  margin: -1.6rem -1.6rem 1.3rem;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--rule);
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-sunk);
}

.card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.card__title {
  font-size: var(--step-1);
}

.card__title a {
  text-decoration: none;
}

.card__tag {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-faint);
  margin-bottom: 0.9rem;
  line-height: 1.5;
}

.card__desc {
  color: var(--ink-soft);
  font-size: 0.96rem;
  flex: 1;
}

.card__links {
  display: flex;
  gap: 1rem;
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.88rem;
}

.card__links a {
  color: var(--accent);
  text-decoration: none;
}

.card__links a:hover {
  text-decoration: underline;
}

.pill {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 100px;
  background: var(--accent-wash);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  white-space: nowrap;
}

.pill--beta {
  background: color-mix(in srgb, var(--marker) 30%, transparent);
  color: color-mix(in srgb, var(--marker) 60%, var(--ink));
  border-color: color-mix(in srgb, var(--marker) 50%, transparent);
}

/* --- CV ------------------------------------------------------------------- */

.cv-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-block: 1.25rem;
  border-block: 1px solid var(--rule);
  margin-bottom: 2.5rem;
  position: sticky;
  top: 4.25rem;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.cv-toolbar__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-right: 0.5rem;
}

.chip {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 100px;
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all var(--speed);
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.cv-toolbar__spacer {
  margin-left: auto;
}

.cv-section {
  margin-bottom: 3.5rem;
}

.cv-section__title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-bottom: 0.75rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

.entry {
  border-bottom: 1px solid var(--rule);
}

.entry[hidden] {
  display: none;
}

.entry__summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1.5rem;
  padding: 1.35rem 0;
  cursor: pointer;
  list-style: none;
  align-items: baseline;
}

.entry__summary::-webkit-details-marker {
  display: none;
}

.entry__role {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.2;
}

.entry__when {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-faint);
  white-space: nowrap;
  text-align: right;
}

.entry__org {
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.entry__where {
  color: var(--ink-faint);
  font-size: 0.82rem;
  text-align: right;
}

.entry__marker {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
  margin-top: 0.35rem;
}

.entry[open] .entry__marker::before {
  content: "− ";
}

.entry:not([open]) .entry__marker::before {
  content: "+ ";
}

.entry__body {
  padding-bottom: 1.6rem;
  max-width: 52rem;
}

.entry__note {
  font-size: 0.86rem;
  color: var(--ink-faint);
  margin-bottom: 0.9rem;
}

.entry__list li {
  position: relative;
  padding-left: 1.15rem;
  margin-bottom: 0.7rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.entry__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
}

.entry__meta {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-faint);
  margin-bottom: 1rem;
}

.skill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: baseline;
  padding-block: 1rem;
  border-bottom: 1px solid var(--rule);
}

.skill-row__label {
  font-size: 0.88rem;
  color: var(--ink-faint);
  width: 8rem;
  flex-shrink: 0;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink-soft);
}

.tag.is-match {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-wash);
}

.empty-note {
  padding: 2rem 0;
  color: var(--ink-faint);
  font-style: italic;
}

.empty-note[hidden] {
  display: none;
}

/* --- feature grid (Huddle) ------------------------------------------------ */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 2rem 2.5rem;
}

.feature__title {
  font-size: 1.06rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.feature__icon {
  color: var(--accent);
  font-size: 0.9rem;
}

.feature__body {
  color: var(--ink-soft);
  font-size: 0.94rem;
}

/* Wide enough that four screenshots settle into 2×2 rather than 3 + a lone
   orphan, and each one is large enough to actually read. */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr));
  gap: 1.25rem;
}

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

/* Screenshots are whole app windows — cropping them to a fixed ratio would cut
   off the chrome that makes them legible, so they keep their own proportions. */
.shot img {
  width: 100%;
  height: auto;
}

.shot figcaption {
  padding: 0.7rem 0.9rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
  border-top: 1px solid var(--rule);
  background: var(--surface);
}

.callout {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 2rem;
}

.callout__title {
  font-size: var(--step-1);
  margin-bottom: 0.6rem;
}

.callout p {
  color: var(--ink-soft);
  max-width: var(--measure);
}

.callout .btn {
  margin-top: 1.25rem;
}

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

.contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--rule);
}

.contact-row__label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  width: 7rem;
  flex-shrink: 0;
}

.contact-row__value {
  font-size: var(--step-1);
  font-family: var(--font-display);
  text-decoration: none;
}

.contact-row__value:hover {
  color: var(--accent);
}

.copy-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  color: var(--ink-faint);
  cursor: pointer;
  transition: all var(--speed);
}

.copy-btn:hover,
.copy-btn.is-done {
  border-color: var(--accent);
  color: var(--accent);
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem 3rem;
  margin-top: auto;
}

/* Three-way theme picker. The header button cycles; this names all the
   options, which is why it lives down here rather than in the chrome. */
.theme-picker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.theme-picker__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.theme-picker__opts {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.theme-picker__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color var(--speed), color var(--speed);
}

.theme-picker__btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-picker__btn.is-active {
  border-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}

/* A one-glyph preview of each skin, so the names are not the only cue. */
.theme-picker__swatch {
  width: 1.15rem;
  height: 1.15rem;
  display: grid;
  place-content: center;
  font-size: 0.7rem;
  border-radius: 2px;
}

.theme-picker__swatch--clean {
  background: #16161a;
  color: #fbfaf7;
}

.theme-picker__swatch--y2k {
  background: #008080;
  color: #c0c0c0;
}

.theme-picker__swatch--xp {
  background: #0055ea;
  color: #ffffff;
}

.theme-picker__swatch--retro {
  background: #000033;
  color: #ffff66;
}

.site-footer__note {
  color: var(--ink-faint);
  font-size: 0.86rem;
  max-width: var(--measure);
}

.site-footer__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.site-footer__top {
  text-decoration: none;
}

/* Y2K ornaments stay out of the clean skin entirely. */
.y2k-only {
  display: none;
}

/* --- responsive ----------------------------------------------------------- */

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
    order: 3;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    cursor: pointer;
  }

  .nav-toggle__bar,
  .nav-toggle__bar::before,
  .nav-toggle__bar::after {
    display: block;
    width: 15px;
    height: 1.5px;
    background: var(--ink);
    content: "";
    position: relative;
  }

  .nav-toggle__bar::before {
    top: -5px;
  }
  .nav-toggle__bar::after {
    top: 3.5px;
  }

  .nav {
    display: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding-bottom: 1rem;
  }

  .nav-open .nav {
    display: flex;
  }

  .nav__link {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--rule);
  }

  .site-header__inner {
    flex-wrap: wrap;
  }

  .controls {
    margin-left: 0;
    order: 2;
  }

  .cv-toolbar {
    position: static;
  }

  .entry__summary {
    grid-template-columns: 1fr;
  }

  .entry__when,
  .entry__where {
    text-align: left;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- print (the CV is the page people will print) ------------------------- */

@media print {
  .site-header,
  .site-footer,
  .cv-toolbar,
  .hero__actions,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 10.5pt;
  }

  .entry__body {
    display: block !important;
  }

  .entry {
    break-inside: avoid;
  }

  a {
    text-decoration: none;
  }
}
