/*
  hasanerdil.dev
  Direction: Swiss / International Typographic. White, black and one signal red. A visible
  12-column grid, heavy condensed capitals, solid colour plates and hard rules.

  Contents
    1. Tokens     4. Hero         7. Tools
    2. Base       5. Work         8. Contact and footer
    3. Grid, bar  6. Experience   9. Motion   10. Narrow screens
*/

/* ========== 1. Tokens ========== */
:root {
  --paper: #ffffff;
  --ink: #0b0b0b;
  --muted: #666666;
  --red: #e1251b;            /* white on red passes 4.5:1 */
  --plate-ink: #0b0b0b;
  --gridline: rgb(0 0 0 / .022);

  --face: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --pad: clamp(20px, 3.2vw, 44px);
  --gap: clamp(12px, 1.6vw, 20px);
  --bar-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --wipe: cubic-bezier(.7, 0, .2, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b0b0b;
    --ink: #f2f2f2;
    --muted: #9a9a9a;
    --plate-ink: #1b1b1b;
    --gridline: rgb(255 255 255 / .03);
  }
}

/* ========== 2. Base ========== */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + 12px);
  background: var(--paper);
}
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--face);
  font-size: 1.125rem;
  line-height: 1.5;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: .18em; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
::selection { background: var(--red); color: #fff; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; padding: 10px 14px; background: var(--ink); color: var(--paper); }

/* condensed display caps: the voice of the whole site */
.giant, .hero-name, .project-head h3, .contact-h, .figure-n {
  font-weight: 900;
  font-stretch: 70%;
  font-variation-settings: "wdth" 66;
  text-transform: uppercase;
  letter-spacing: -.015em;
}

/* ========== 3. Grid and bar ========== */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
}
/* the column grid shows faintly behind the page */
body::before {
  content: "";
  position: fixed;
  inset: 0 var(--pad);
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(90deg,
    var(--gridline) 0 calc((100% - 11 * var(--gap)) / 12),
    transparent calc((100% - 11 * var(--gap)) / 12) calc((100% - 11 * var(--gap)) / 12 + var(--gap)));
}

.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--bar-h);
  padding: 0 var(--pad);
  background: var(--paper);
  border-bottom: 3px solid transparent;
  font-weight: 700;
  transition: border-color .3s ease;
}
.bar.is-stuck { border-bottom-color: var(--ink); }
.bar-name { text-decoration: none; }
.bar nav { display: flex; gap: clamp(16px, 2.4vw, 32px); }
.bar nav a {
  text-decoration: none;
  background: linear-gradient(var(--red), var(--red)) 0 100% / 0 3px no-repeat;
  padding-bottom: 2px;
  transition: background-size .3s var(--ease), color .2s;
}
.bar nav a:hover, .bar nav a[aria-current="true"] { background-size: 100% 3px; color: var(--ink); }

.section { padding: clamp(80px, 11vw, 160px) var(--pad) 0; }
.giant {
  overflow: hidden;
  padding-top: 14px;
  border-top: 3px solid var(--ink);
  font-size: clamp(5rem, 17vw, 19rem);
  line-height: .8;
  margin-bottom: clamp(40px, 6vw, 88px);
}
.giant .slide { display: inline-block; }

/* ========== 4. Hero ========== */
.hero {
  min-height: calc(100svh - var(--bar-h));
  grid-template-rows: 1fr auto;
  row-gap: 40px;
  padding: clamp(24px, 4vh, 48px) var(--pad) clamp(28px, 4vh, 40px);
}
.hero-name {
  grid-column: 1 / span 9;
  align-self: center;
  font-size: clamp(4.5rem, 14.5vw, 15.5rem);
  line-height: .8;
}
.mask { display: block; overflow: hidden; padding-bottom: .04em; }
.mask > span { display: inline-block; }
.hero-name .indent { padding-left: 1.05em; }
.hero-block {
  grid-column: 10 / span 3;
  align-self: center;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(18px, 2vw, 28px);
  background: var(--red);
  color: #fff;
  font-weight: 600;
  line-height: 1.3;
}
.hero-role {
  font-weight: 900;
  font-variation-settings: "wdth" 70;
  font-size: clamp(2.2rem, 4.4vw, 4.6rem);
  line-height: .9;
  text-transform: uppercase;
}
.hero-facts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--gap);
  border-top: 3px solid var(--ink);
  padding-top: 16px;
}
.hero-facts a { display: block; text-decoration: none; font-size: 1rem; line-height: 1.4; color: var(--muted); }
.hero-facts b { display: block; margin-bottom: 4px; color: var(--ink); font-size: 1.4rem; font-weight: 800; }
.hero-facts a:hover b { color: var(--red); }

/* ========== 5. Work ========== */
.project {
  row-gap: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
  align-items: start;
}
.project + .project { margin-top: clamp(72px, 9vw, 128px); }
.project-head, .project-figure, .project-facts { grid-column: 1 / span 6; }
.project-years { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--muted); }
.project-head h3 { font-size: clamp(4.5rem, 11vw, 11rem); line-height: .82; margin-top: 10px; }
.project-what { margin-top: 20px; max-width: 34rem; font-size: 1.3rem; line-height: 1.4; }
.figure-n { color: var(--red); font-size: clamp(5rem, 10vw, 9.5rem); line-height: .85; font-variant-numeric: tabular-nums; }
.figure-l { margin-top: 6px; font-weight: 700; font-size: 1.2rem; }
.project-facts > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: var(--gap); padding: 14px 0; border-top: 1px solid var(--ink); }
.project-facts dt { font-weight: 800; }
.project-facts dd { color: var(--muted); }

.project-plate {
  grid-column: 8 / span 5;
  grid-row: 1 / span 3;
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  padding: 40px;
  overflow: hidden;
}
#fides .project-plate { grid-row: 1 / span 2; }
.plate--red { background: var(--red); }
.plate--ink { background: var(--plate-ink); }
.plate-logo { position: absolute; top: 20px; left: 20px; width: 64px; height: auto; padding: 8px; background: #fff; }
.plate-note { position: absolute; left: 20px; bottom: 16px; color: #bdbdbd; font-size: .9rem; font-style: italic; }

.phone, .browser { overflow: hidden; background: #fff; }
.phone {
  width: min(62%, 280px);
  aspect-ratio: 9 / 20;
  border: 8px solid #0b0b0b;
  border-radius: 34px;
  box-shadow: 0 30px 50px -20px rgb(0 0 0 / .45);
}
.phone img, .browser img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.browser {
  width: 100%;
  aspect-ratio: 16 / 12;
  border: 1px solid #000;
  border-top: 16px solid #2a2a2a;
  box-shadow: 0 30px 50px -20px rgb(0 0 0 / .6);
}
.phone--small { position: absolute; right: 24px; bottom: 44px; width: 32%; border-width: 6px; border-radius: 22px; }

.live { display: inline-block; width: 10px; height: 10px; background: var(--red); }

/* ========== 6. Experience ========== */
.row {
  position: relative;
  align-items: start;
  padding: 22px 0 26px;
  isolation: isolate;
}
.row::before {   /* the rule above each row draws in from the left */
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: var(--ink);
  transform-origin: left;
}
.row::after {    /* the red fill that sweeps in on hover */
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 calc(-1 * var(--pad));
  background: var(--red);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .45s var(--wipe);
}
.rows .row:last-child { border-bottom: 1px solid var(--ink); }
.row-when { grid-column: 1 / span 2; font-weight: 900; font-variation-settings: "wdth" 70; font-size: 2.4rem; line-height: 1; }
.row-when span { display: block; margin-top: 6px; font-weight: 500; font-variation-settings: "wdth" 100; font-size: .9rem; line-height: 1.3; color: var(--muted); }
.row-what { grid-column: 3 / span 4; font-size: 1.5rem; font-weight: 800; line-height: 1.15; }
.row-what span { display: block; margin-top: 6px; font-size: 1.05rem; font-weight: 500; color: var(--muted); }
.row-desc { grid-column: 7 / span 5; color: var(--muted); }
.row-tag { grid-column: 12; justify-self: end; padding: 4px 10px; background: var(--red); color: #fff; font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
.row, .row * { transition: color .25s ease; }
@media (hover: hover) {
  .row:hover::after { transform: scaleY(1); }
  .row:hover, .row:hover .row-when span, .row:hover .row-what span, .row:hover .row-desc { color: #fff; }
  .row:hover .row-tag { background: #fff; color: var(--red); }
}

/* ========== 7. Tools ========== */
.tools > div { grid-column: span 3; border-top: 6px solid var(--red); padding-top: 14px; }
.tools h3 { font-size: 1.4rem; font-weight: 800; margin-bottom: 14px; }
.tools li { font-size: 1.3rem; line-height: 1.55; }

/* ========== 8. Contact and footer ========== */
.contact {
  margin-top: clamp(96px, 12vw, 176px);
  padding: clamp(56px, 8vw, 112px) var(--pad);
  background: var(--red);
  color: #fff;
}
.contact-inner { align-items: end; row-gap: 40px; }
.contact-h { grid-column: 1 / span 7; font-size: clamp(5rem, 14vw, 15rem); line-height: .8; }
.contact-body { grid-column: 8 / span 5; font-size: 1.2rem; }
.mail {
  display: inline-block;
  margin-top: 10px;
  font-weight: 800;
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  line-height: 1.15;
  color: #fff;
  overflow-wrap: anywhere;
  text-decoration-thickness: 3px;
}
.mail:hover { color: #fff; text-decoration-thickness: 6px; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; margin-top: 28px; font-weight: 700; }
.contact-actions a { color: #fff; }
.contact-actions a:hover { color: var(--ink); }
.copy {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  background: #fff;
  color: var(--red);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.copy:hover { background: var(--ink); color: #fff; }

.foot { padding: 22px var(--pad) 30px; font-size: .95rem; font-weight: 600; }
.foot p:nth-child(1) { grid-column: 1 / span 4; }
.foot p:nth-child(2) { grid-column: 5 / span 4; color: var(--muted); }
.foot p:nth-child(3) { grid-column: 9 / span 4; justify-self: end; }

/* ========== 9. Motion (all skipped for reduced motion) ========== */
@media (prefers-reduced-motion: no-preference) {
  /* page load: the name rises line by line, the red block wipes open */
  .hero-name .mask > span { animation: rise .95s var(--ease) both; }
  .hero-name .mask:nth-child(2) > span { animation-delay: .09s; }
  .hero-name .mask:nth-child(3) > span { animation-delay: .18s; }
  .hero-block { animation: wipe-x .9s var(--wipe) .35s both; }
  .hero-block > * { animation: fade .6s ease .95s both; }
  .hero-facts { animation: fade-up .8s var(--ease) .7s both; }
  .bar { animation: fade .6s ease .1s both; }

  /* section titles drift sideways with the scroll */
  @supports (animation-timeline: view()) {
    .giant .slide { animation: slide linear both; animation-timeline: view(); animation-range: entry 0% cover 55%; }
  }

  /* colour plates wipe open, then the devices rise into them */
  .js .project-plate { clip-path: inset(0 100% 0 0); transition: clip-path 1s var(--wipe); }
  .js .project.is-in .project-plate { clip-path: inset(0 0 0 0); }
  .js .project-plate > * { opacity: 0; translate: 0 50px; transition: opacity .6s ease .6s, translate .9s var(--ease) .6s; }
  .js .project.is-in .project-plate > * { opacity: 1; translate: 0 0; }
  .js .project.is-in .phone--small { transition-delay: .8s; }

  /* experience rules draw in, row by row */
  .js .row::before { transform: scaleX(0); transition: transform .9s var(--wipe); transition-delay: calc(var(--i, 0) * 90ms); }
  .js .row > * { opacity: 0; transition: opacity .6s ease, color .25s ease; transition-delay: calc(var(--i, 0) * 90ms + .2s), 0s; }
  .js .rows.is-in .row::before { transform: scaleX(1); }
  .js .rows.is-in .row > * { opacity: 1; }

  .js .tools > div { opacity: 0; translate: 0 30px; transition: opacity .6s ease, translate .8s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
  .js .tools.is-in > div { opacity: 1; translate: 0 0; }

  .js .contact-h .mask > span { transform: translateY(105%); transition: transform .9s var(--ease); }
  .js .contact-h .mask:nth-child(2) > span { transition-delay: .1s; }
  .js .contact.is-in .contact-h .mask > span { transform: none; }

  .live { animation: blink 1.6s steps(2, jump-none) infinite; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .row::after { transition: none; }
}

@keyframes rise    { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes wipe-x  { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes slide   { from { transform: translateX(14vw); } to { transform: none; } }
@keyframes blink   { 0% { opacity: 1; } 100% { opacity: .2; } }

/* ========== 10. Narrow screens ========== */
@media (max-width: 960px) {
  .hero { grid-template-rows: auto; align-content: center; row-gap: 28px; }
  .hero-name { grid-column: 1 / -1; }
  .hero-block { grid-column: 1 / span 7; aspect-ratio: auto; min-height: 200px; }
  .project-head, .project-figure, .project-facts { grid-column: 1 / -1; }
  .project-plate, #fides .project-plate { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 4 / 4.2; }
  .row-when { grid-column: 1 / span 3; }
  .row-what { grid-column: 4 / span 9; }
  .row-desc { grid-column: 4 / span 9; margin-top: 10px; }
  .row-tag { grid-column: 1 / span 3; grid-row: 2; justify-self: start; margin-top: 12px; }
  .tools > div { grid-column: span 6; margin-bottom: 28px; }
  .contact-h, .contact-body { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  :root { --bar-h: 56px; }
  .bar-name { font-size: 0; }
  .bar-name::before { content: "H.E.A."; font-size: 1.05rem; }
  .bar nav { gap: 16px; font-size: .95rem; }
  .bar nav a[href="#tools"] { display: none; }
  .hero-block { grid-column: 1 / -1; }
  .hero-facts { grid-template-columns: 1fr; row-gap: 16px; }
  .row-when, .row-what, .row-desc, .row-tag { grid-column: 1 / -1; }
  .row-what { margin-top: 12px; }
  .row-tag { grid-row: auto; }
  .tools > div { grid-column: 1 / -1; }
  .project-facts > div { grid-template-columns: 1fr; gap: 4px; }
  .foot p:nth-child(n) { grid-column: 1 / -1; justify-self: start; }
  .phone--small { right: 12px; bottom: 40px; }
}
