/* Kerem Çimentepe — portfolio
   One family (Inter / Inter Display), cool ink-on-paper palette, left rail layout. */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-4.0-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-4.0-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("/assets/fonts/inter-display-4.0-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f7f8fa;
  --surface: #ffffff;
  --ink: #172130;
  --muted: #566273;
  --rule: #dce1e8;
  --rule-strong: #828d9c;
  --accent: #4a37c0;
  --accent-hover: #3b2aa3;
  --accent-ink: #ffffff;

  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --font-display: "Inter Display", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-code: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 1.95rem;
  --step-4: clamp(2.75rem, 1.6rem + 5.2vw, 5rem);

  --gutter: 1rem;
  --rail: 11.5rem;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f151e;
    --surface: #161f2c;
    --ink: #e4e8ee;
    --muted: #9ba7b6;
    --rule: #263244;
    --rule-strong: #5b6a7f;
    --accent: #a99dff;
    --accent-hover: #c2b9ff;
    --accent-ink: #10131c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f151e;
  --surface: #161f2c;
  --ink: #e4e8ee;
  --muted: #9ba7b6;
  --rule: #263244;
  --rule-strong: #5b6a7f;
  --accent: #a99dff;
  --accent-hover: #c2b9ff;
  --accent-ink: #10131c;
  color-scheme: dark;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.6;
  /* ss04: serif capital I and tailed l, so I / l / İ / ı never blur together */
  font-feature-settings: "ss04";
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p,
ul,
dl,
dd,
figure {
  margin: 0;
}

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

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

code {
  font-family: var(--font-code);
  font-size: 0.9em;
}

.wrap {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 0.9rem;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 0.35rem;
  font-weight: 600;
  text-decoration: none;
}
.skip:focus {
  top: 0.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5rem;
  padding-block: 0.75rem;
}

.site-nav {
  display: none;
  margin-right: auto;
}
.site-nav ul {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  padding: 0;
}
.site-nav a,
.lang {
  color: var(--muted);
  text-decoration: none;
  font-size: var(--step--1);
  display: inline-block;
  padding-block: 0.6rem;
}
.site-nav a:hover,
.lang:hover {
  color: var(--ink);
  text-decoration: underline;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--ink);
  background: var(--rule);
}
.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

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

.hero {
  padding-block: 2.5rem 3.5rem;
}

.hero h1 {
  font-size: var(--step-4);
  line-height: 1;
  letter-spacing: -0.032em;
  margin-bottom: 1.25rem;
}

.lead {
  font-size: var(--step-1);
  line-height: 1.45;
  max-width: 34ch;
  margin-bottom: 2.25rem;
}

.facts {
  display: grid;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  max-width: 62rem;
}
.facts dt {
  color: var(--muted);
  font-size: var(--step--1);
}
.facts dd {
  font-variant-numeric: tabular-nums;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 2.25rem;
}

.btn {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.65rem 1.1rem;
  border-radius: 0.4rem;
  border: 1px solid transparent;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}
.btn-secondary {
  border-color: var(--rule-strong);
  color: var(--ink);
  background: transparent;
}
.btn-secondary:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.btn-note {
  font-weight: 400;
  font-size: var(--step--1);
  opacity: 0.85;
}

.actions .text-links {
  display: flex;
  gap: 1.5rem;
}
.actions .text-links a {
  display: inline-block;
  padding-block: 0.6rem;
  font-weight: 600;
}

/* Sections -------------------------------------------------------------- */

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

.section > h2 {
  font-size: var(--step-2);
  letter-spacing: -0.012em;
  margin-bottom: 1.75rem;
}

.section-body {
  min-width: 0;
}

.prose p {
  max-width: 64ch;
}

.about-intro {
  font-size: 1.1875rem;
  line-height: 1.55;
}

.subgrid {
  display: grid;
  gap: 2rem;
  margin-top: 2.5rem;
}

h3.minor {
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.4;
  letter-spacing: 0;
  margin-bottom: 0.5rem;
}

.muted {
  color: var(--muted);
}

.edu p + p {
  margin-top: 0.25rem;
}
.tnum {
  font-variant-numeric: tabular-nums;
}

.lang-list {
  display: grid;
  gap: 0.5rem;
}
.lang-list dt {
  font-weight: 600;
}

/* Projects -------------------------------------------------------------- */

.project-head h3 {
  font-size: var(--step-3);
  letter-spacing: -0.02em;
}
.project-kind {
  color: var(--muted);
  margin-top: 0.35rem;
}

.project-summary {
  font-size: 1.1875rem;
  line-height: 1.55;
  max-width: 60ch;
  margin-top: 1.25rem;
}

.stack {
  color: var(--muted);
  font-size: var(--step--1);
  margin-top: 0.75rem;
  max-width: 70ch;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1.5rem;
  margin-top: 1.25rem;
}
.project-links a {
  display: inline-block;
  padding-block: 0.5rem;
  font-weight: 600;
}
.project-links .note {
  flex-basis: 100%;
  color: var(--muted);
  font-size: var(--step--1);
}

/* Request path: the one bold element ------------------------------------ */

.route-figure {
  container-type: inline-size;
  margin-block: 2.25rem;
  padding: 1.5rem 1.25rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
}

.route {
  --line: 1.5px;
  --line-color: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.node {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule-strong);
  border-radius: 0.35rem;
  background: var(--paper);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.3;
  white-space: nowrap;
}
.node-hub {
  border-color: var(--accent);
  color: var(--accent);
  border-width: 2px;
  padding: calc(0.5rem - 1px) calc(0.75rem - 1px);
}

/* Edges are drawn with borders: a line plus a small arrowhead. */
.edge {
  position: relative;
  flex: none;
}
.edge-label {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1;
  white-space: nowrap;
}
code.edge-label {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8125rem;
}

/* Vertical edges (narrow layout) */
.route > .edge {
  height: 2.75rem;
  margin-left: 1.5rem;
  border-left: var(--line) solid var(--line-color);
}
.route > .edge::after {
  content: "";
  position: absolute;
  left: calc(-4px - var(--line) / 2);
  bottom: 0;
  border-top: 7px solid var(--line-color);
  border-inline: 4px solid transparent;
}
.route > .edge .edge-label {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-60%);
}

.route .joint {
  display: block;
  height: 0.9rem;
  margin-left: 1.5rem;
  border-left: var(--line) solid var(--line-color);
}

.branches {
  position: relative;
  display: grid;
  gap: 0.9rem;
  margin-left: 1.5rem;
}
/* the trunk: from the hub down to the middle of the last branch */
.branches::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 1.2rem;
  border-left: var(--line) solid var(--line-color);
}

.branch {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  align-items: center;
}
.branch > .node {
  justify-self: start;
}
.branch > .edge-inner,
.branch > .edge-inner ~ .node {
  grid-column: 2;
}

/* entry edge of a branch: horizontal, labelled with the route pattern */
.branch .edge-entry {
  width: 4.25rem;
  height: 2.4rem;
}
.branch .edge-entry::before,
.branch .edge-inner::before {
  content: "";
  position: absolute;
  left: 0;
  right: 5px;
  top: 50%;
  border-top: var(--line) solid var(--line-color);
}
.branch .edge-entry::after,
.branch .edge-inner::after {
  content: "";
  position: absolute;
  right: 0;
  top: calc(50% - 4px + var(--line) / 2);
  border-left: 7px solid var(--line-color);
  border-block: 4px solid transparent;
}
.branch .edge .edge-label {
  position: absolute;
  left: 0.55rem;
  bottom: calc(50% + 0.3rem);
}

/* API -> database edge: vertical on narrow screens */
.branch .edge-inner {
  height: 1.6rem;
  margin-left: 1.5rem;
}
.branch .edge-inner::before {
  right: auto;
  top: 0;
  bottom: 6px;
  border-top: 0;
  border-left: var(--line) solid var(--line-color);
}
.branch .edge-inner::after {
  right: auto;
  left: calc(-4px + var(--line) / 2);
  top: auto;
  bottom: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 7px solid var(--line-color);
  border-bottom: 0;
}

.route-figure figcaption {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: var(--step--1);
  line-height: 1.55;
  max-width: 72ch;
}

/* Wide layout: one horizontal line of travel */
@container (min-width: 46rem) {
  .route {
    flex-direction: row;
    align-items: center;
  }
  .route > .edge {
    height: auto;
    width: 4.5rem;
    margin-left: 0;
    border-left: 0;
    align-self: stretch;
  }
  .route > .edge::before {
    content: "";
    position: absolute;
    left: 0.25rem;
    right: 5px;
    top: 50%;
    border-top: var(--line) solid var(--line-color);
  }
  .route > .edge::after {
    left: auto;
    right: 0;
    bottom: auto;
    top: calc(50% - 4px + var(--line) / 2);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-inline: 0;
    border-left: 7px solid var(--line-color);
  }
  .route > .edge .edge-label {
    left: 0;
    right: 0;
    top: auto;
    bottom: calc(50% + 0.4rem);
    transform: none;
    text-align: center;
  }
  .route .joint {
    width: 1.25rem;
    height: 0;
    margin-left: 0;
    border-left: 0;
    border-top: var(--line) solid var(--line-color);
  }
  .branches {
    margin-left: 0;
    gap: 1rem;
  }
  .branches::before {
    top: 1.2rem;
    bottom: 1.2rem;
  }
  .route-figure {
    padding: 2rem 2rem 1.5rem;
  }
  .node {
    font-size: 1rem;
    padding: 0.6rem 0.9rem;
  }
  .node-hub {
    padding: calc(0.6rem - 1px) calc(0.9rem - 1px);
  }
  .route > .edge {
    width: 5.25rem;
  }
  .branches::before {
    top: 1.35rem;
    bottom: 1.35rem;
  }
  .branch {
    display: flex;
    align-items: center;
  }
  .branch .edge-entry {
    width: 5.25rem;
    height: 2.7rem;
  }
  .branch .edge-inner {
    width: 2.75rem;
    height: 2.7rem;
    margin-left: 0;
  }
  .branch .edge-inner::before {
    left: 0;
    right: 5px;
    top: 50%;
    bottom: auto;
    border-left: 0;
    border-top: var(--line) solid var(--line-color);
  }
  .branch .edge-inner::after {
    left: auto;
    right: 0;
    top: calc(50% - 4px + var(--line) / 2);
    bottom: auto;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-right: 0;
    border-left: 7px solid var(--line-color);
  }
}

.details {
  display: grid;
  gap: 1rem;
  max-width: 68ch;
}
.details dt {
  font-weight: 600;
}

.project {
  margin-top: 3rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--rule);
}
.project h3 {
  font-size: var(--step-2);
  letter-spacing: -0.014em;
}
.points {
  margin-top: 1rem;
  padding-left: 1.15rem;
  max-width: 66ch;
}
.points li + li {
  margin-top: 0.4rem;
}
.points li::marker {
  color: var(--muted);
}

.more {
  margin-top: 2.5rem;
}
.more a {
  font-weight: 600;
  display: inline-block;
  padding-block: 0.4rem;
}

/* Skills ---------------------------------------------------------------- */

.skills {
  display: grid;
  max-width: 62rem;
}
.skills > div {
  display: grid;
  gap: 0.2rem;
  padding-block: 0.9rem;
  border-top: 1px solid var(--rule);
}
.skills > div:first-child {
  border-top: 0;
  padding-top: 0;
}
.skills dt {
  font-weight: 600;
}

/* Contact --------------------------------------------------------------- */

.email-big {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 0.9rem + 2.6vw, 2.4rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 1.25rem;
  overflow-wrap: anywhere;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 1.5rem;
}
.contact-actions a:not(.btn) {
  font-weight: 600;
  display: inline-block;
  padding-block: 0.6rem;
}
.copy-btn {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* Footer ---------------------------------------------------------------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: var(--step--1);
}

/* 404 ------------------------------------------------------------------- */

.notfound {
  padding-block: 5rem;
  display: grid;
  gap: 1rem;
  max-width: 40rem;
}
.notfound h1,
.notfound h2 {
  font-size: var(--step-3);
}
.notfound-tr {
  margin-top: 2rem;
}

/* Breakpoints ----------------------------------------------------------- */

@media (min-width: 40rem) {
  .facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
  }
  .subgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3rem;
  }
  .details > div {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 1rem;
  }
  .skills > div {
    grid-template-columns: 13rem minmax(0, 1fr);
    gap: 1.5rem;
  }
}

@media (min-width: 48rem) {
  :root {
    --gutter: 2rem;
  }
  .site-nav {
    display: block;
  }
  .site-header {
    padding-block: 1rem;
  }
  .hero {
    padding-block: 5rem 4.5rem;
  }
  .lead {
    font-size: 1.5rem;
  }
}

@media (min-width: 60rem) {
  .section {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    column-gap: 3rem;
    padding-block: 4rem;
  }
  .section > h2 {
    font-size: 1.375rem;
    margin: 0;
    position: sticky;
    top: 1.5rem;
    align-self: start;
    padding-top: 0.15rem;
  }
  .hero {
    padding-left: calc(var(--rail) + 3rem);
  }
  .facts {
    margin-left: 0;
  }
}

@media print {
  .site-header,
  .theme-toggle,
  .copy-btn,
  .skip {
    display: none !important;
  }
  .section > h2 {
    position: static;
  }
}
