/*
  zahidcakici: personal site

  Layout: one left-aligned column. A statement and a small portrait up top,
  then the five profiles as full-width rows. One accent colour, and it is only
  ever used the way a highlighter pen would be.
*/

/* ---------- Fonts (self-hosted, SIL Open Font License) ---------- */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/bricolage-grotesque-latin-opsz-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/bricolage-grotesque-latin-ext-opsz-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/instrument-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/dm-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/dm-mono-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ---------- */

:root {
  --paper: #edeeea;
  --ink: #16191b;
  --muted: #5c6266;
  --rule: #c9cdc7;
  --mark: #ffd84a;
  --on-mark: #16191b;

  --font-display: "Bricolage Grotesque", "Arial Narrow", Arial, sans-serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(1.25rem, 5vw, 3rem);
  --measure: 70rem;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131516;
    --ink: #eceee9;
    --muted: #979da0;
    --rule: #2f3335;
    --mark: #ffd84a;
    --on-mark: #16191b;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
p,
ul,
figure {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

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

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

::selection {
  background: var(--mark);
  color: var(--on-mark);
}

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

/* Highlighter stroke. The only place the accent colour appears at rest. */
.mark {
  position: relative;
  isolation: isolate;
  color: var(--on-mark);
  white-space: nowrap;
}
.mark::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0.14em -0.14em 0.04em -0.12em;
  background: var(--mark);
  border-radius: 0.08em 0.2em 0.1em 0.16em;
  transform: rotate(-1.1deg);
}

/* ---------- Page frame ---------- */

.page {
  max-width: var(--measure);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: 1.75rem;
}

.top-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.top-place {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* ---------- Intro ---------- */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17.5rem;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  padding-block: clamp(2.5rem, 8vw, 6.5rem) clamp(3.5rem, 9vw, 7.5rem);
}

.intro-text {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.375rem, 1.2rem + 5.2vw, 4.75rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.022em;
  text-wrap: balance;
  margin-bottom: 0.75rem;
}

.hello {
  display: block;
  color: var(--muted);
}

.intro-text p {
  max-width: 34rem;
  font-size: 1.1875rem;
}

.intro-text p.quiet {
  color: var(--muted);
}

.portrait {
  /* nudged down so the top of the photo sits with the first line of the headline */
  margin-top: 0.5rem;
  transform: rotate(1.6deg);
}

.portrait img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  filter: grayscale(1) contrast(1.04);
}

/* ---------- Links ---------- */

.links {
  padding-bottom: clamp(3.5rem, 9vw, 7rem);
}

.links-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 2rem;
  padding-bottom: 1.25rem;
}

h2 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.links-head p {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.links-head .mark {
  margin-left: 0.35em;
}

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

.links a {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 5fr) 1.25rem;
  align-items: baseline;
  gap: 1.5rem;
  /* the fill on hover reaches a little past the text edge, like a marker would */
  margin-inline: -0.75rem;
  padding: 1.15rem 0.75rem 1.25rem;
  transition: background-color 0.12s ease-out, color 0.12s ease-out;
}

.where {
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 1.2rem + 1.6vw, 2.375rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.what {
  color: var(--muted);
  transition: color 0.12s ease-out;
}

.url {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--muted);
  text-align: right;
  overflow-wrap: anywhere;
  transition: color 0.12s ease-out;
}

.url b {
  font-weight: 400;
  color: var(--ink);
  transition: color 0.12s ease-out;
}

.arrow {
  width: 1.125rem;
  height: 1.125rem;
  align-self: center;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
  transition: transform 0.16s ease-out;
}

.links a:hover,
.links a:focus-visible {
  background: var(--mark);
  color: var(--on-mark);
}
.links a:hover .what,
.links a:hover .url,
.links a:hover .url b,
.links a:focus-visible .what,
.links a:focus-visible .url,
.links a:focus-visible .url b {
  color: var(--on-mark);
}
.links a:hover .arrow,
.links a:focus-visible .arrow {
  transform: translate(3px, -3px);
}
.links a:focus-visible {
  outline-offset: 0;
}

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

.bottom {
  padding-block: 0 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

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

.lost {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  padding-block: clamp(3rem, 12vw, 9rem);
}

.lost a {
  border-bottom: 1px solid currentColor;
}
.lost a:hover {
  background: var(--mark);
  color: var(--on-mark);
  border-bottom-color: transparent;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 52rem) {
  .intro {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .portrait {
    order: -1;
    width: 8.5rem;
    margin-top: 0;
  }

  .links a {
    grid-template-columns: minmax(0, 1fr) 1.25rem;
    gap: 0.25rem 1rem;
    padding-block: 1rem 1.1rem;
  }

  .what {
    display: none;
  }

  .url {
    grid-column: 1;
    grid-row: 2;
    text-align: left;
  }

  .arrow {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
