/* ==========================================================================
   Melih Güçlü — Portfolio
   ========================================================================== */

:root {
  --bg: #0a0a09;
  --bg-2: #121210;
  --fg: #ebe6dc;
  --fg-dim: #a39e93;
  --muted: #6f6b63;
  --line: rgba(235, 230, 220, 0.12);
  --line-strong: rgba(235, 230, 220, 0.28);
  --copper: #e2763a;
  --copper-hi: #ffb07a;

  --paper: #ebe6dc;
  --ink: #12110f;
  --ink-dim: #5d5950;
  --ink-line: rgba(18, 17, 15, 0.14);

  --gutter: clamp(16px, 3.2vw, 48px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--copper); color: var(--bg); }

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.muted { color: var(--muted); }
.container { padding: 0 var(--gutter); }

:focus-visible { outline: 1px solid var(--copper); outline-offset: 4px; }

/* ---------- Section label ---------- */
.section-label {
  display: flex;
  gap: 14px;
  align-items: center;
  color: var(--fg-dim);
}
.section-label span { color: var(--copper); }

/* ---------- Text split helpers ---------- */
.split-mask { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.12em 0 0.06em; margin: -0.12em 0 -0.06em; }
.split-char, .split-line { display: inline-block; will-change: transform; }

/* ==========================================================================
   Boot / preloader
   ========================================================================== */
.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--gutter);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.boot__log { display: grid; gap: 6px; max-width: 420px; padding-top: 64px; }
.boot__log p {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--fg-dim);
  opacity: 0;
}
.boot__log i { font-style: normal; color: var(--copper); }
.boot__count {
  font-family: var(--font-display);
  font-variation-settings: "wdth" 62;
  font-weight: 300;
  font-size: clamp(96px, 22vw, 320px);
  line-height: 0.8;
  letter-spacing: -0.04em;
  align-self: flex-end;
  display: flex;
  align-items: flex-start;
}
.boot__pct { font-size: 0.25em; color: var(--copper); margin-left: 0.1em; line-height: 1; }
.boot__bar { height: 1px; background: var(--line); margin-top: 24px; }
.boot__bar span { display: block; height: 100%; width: 100%; background: var(--copper); transform: scaleX(0); transform-origin: left; }

/* ==========================================================================
   Cursor + grain
   ========================================================================== */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }
  .cursor { display: block; position: fixed; inset: 0; pointer-events: none; z-index: 90; }
  .cursor__dot, .cursor__ring {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
  }
  .cursor__dot { width: 4px; height: 4px; margin: -2px 0 0 -2px; background: var(--copper); }
  .cursor__ring {
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 1px solid rgba(235, 230, 220, 0.45);
    display: grid;
    place-items: center;
    transition: width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out), background-color .25s, border-color .25s;
    mix-blend-mode: difference;
  }
  .cursor__label {
    font-family: var(--font-mono);
    font-size: 8.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--bg);
    opacity: 0;
    transition: opacity .2s;
  }
  .cursor.is-hover .cursor__ring { width: 40px; height: 40px; margin: -20px 0 0 -20px; border-color: transparent; background: var(--fg); }
  .cursor.is-label .cursor__ring { width: 52px; height: 52px; margin: -26px 0 0 -26px; border-color: transparent; background: var(--fg); }
  .cursor.is-label .cursor__label { opacity: 1; }
  .cursor.is-hover .cursor__dot, .cursor.is-label .cursor__dot { opacity: 0; }
}

.grain {
  position: fixed;
  inset: -50%;
  z-index: 80;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px var(--gutter);
  mix-blend-mode: difference;
  color: #fff;
}
.nav__brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; letter-spacing: -0.01em; justify-self: start; }
.nav__brand svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.nav__meta { display: inline-flex; align-items: center; gap: 8px; }
.nav__meta-time { display: inline-flex; align-items: center; gap: 6px; opacity: 0.85; }
.nav__dot { width: 6px; height: 6px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 0 rgba(61, 220, 132, .6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .55); } 70% { box-shadow: 0 0 0 8px rgba(61, 220, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); } }

/* Language Switcher */
.nav__lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 10px;
  padding: 2px 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  pointer-events: auto !important;
}

.lang-btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.7);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 999px;
  cursor: pointer !important;
  pointer-events: auto !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.04em;
  user-select: none;
}

.lang-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
}

.lang-btn.is-active {
  color: #000;
  background: #fff;
  border-color: #fff;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.45);
}

.nav__links { justify-self: end; display: flex; gap: clamp(14px, 2.4vw, 32px); }
.nav__links a { position: relative; padding: 4px 0; }
.nav__links sup { font-size: 8px; margin-right: 3px; opacity: .6; vertical-align: top; }
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s var(--ease-out);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }

@media (max-width: 720px) {
  .nav { grid-template-columns: auto 1fr; padding: 12px var(--gutter); gap: 8px 10px; }
  .nav__meta { justify-self: end; }
  .nav__links { grid-column: 1 / -1; justify-self: stretch; justify-content: space-between; }
  .nav__meta { display: inline-flex; }
  .nav__meta-time, .nav__dot { display: none; }
  .nav__lang-switcher { margin-left: 0; padding: 2px 3px; gap: 2px; }
  .lang-btn { padding: 3px 6px; font-size: 10px; }
  .nav__brand span { display: none; }
  .nav__links sup { display: none; }
  .nav__links { gap: 12px; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  background: radial-gradient(120% 80% at 70% 40%, #17150f 0%, var(--bg) 60%);
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(10, 10, 9, 0.75) 22%, rgba(10, 10, 9, 0) 55%),
    linear-gradient(to bottom, rgba(10, 10, 9, 0.7) 0%, rgba(10, 10, 9, 0) 22%);
}
.hero__inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 96px var(--gutter) clamp(20px, 3vw, 40px);
  pointer-events: none;
}
.hero__inner a { pointer-events: auto; }

.hero__top { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.hero__label { display: inline-flex; gap: 10px; align-items: center; color: var(--fg); }
.tick { width: 18px; height: 1px; background: var(--copper); display: inline-block; }
.hero__readout { display: grid; gap: 6px; text-align: right; color: var(--fg-dim); }
.hero__readout b { color: var(--copper); font-weight: 500; margin-right: 8px; }

.hero__title {
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  font-size: clamp(64px, 14.6vw, 264px);
  line-height: 0.94;
  letter-spacing: -0.045em;
  margin-top: auto;
  margin-bottom: clamp(16px, 2.4vw, 36px);
}
.hero__title .line { display: block; overflow: hidden; padding: 0.14em 0 0.04em; margin-top: -0.14em; }
.hero__title .line--2 { display: flex; align-items: flex-end; gap: 0.12em; }
.hero__title .word { display: inline-block; }
.hero__chip {
  display: inline-block;
  font-size: max(9px, 0.055em);
  line-height: 1.4;
  letter-spacing: 0.08em;
  font-weight: 400;
  color: var(--copper);
  border: 1px solid var(--copper);
  padding: 0.6em 0.9em;
  margin-bottom: 0.9em;
  white-space: nowrap;
}

.hero__bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.hero__lede {
  max-width: 520px;
  font-size: clamp(16px, 1.45vw, 21px);
  line-height: 1.35;
  color: var(--fg);
  font-variation-settings: "wdth" 92;
}
.hero__scroll { display: inline-flex; align-items: center; gap: 14px; color: var(--fg-dim); white-space: nowrap; }
.hero__scroll-line { width: 64px; height: 1px; background: var(--line-strong); overflow: hidden; position: relative; }
.hero__scroll-line i { position: absolute; inset: 0; background: var(--copper); animation: scrollline 2.2s var(--ease-out) infinite; }
@keyframes scrollline { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }

@media (max-width: 720px) {
  .hero__inner { padding-top: 100px; }
  .work__art-top { flex-wrap: wrap; }
  .hero__top { flex-direction: column; gap: 14px; }
  .hero__readout { text-align: left; }
  .hero__readout li:nth-child(3) { display: none; }
  .hero__title {
    font-size: clamp(38px, 11vw, 56px);
    line-height: 0.96;
    letter-spacing: -0.03em;
    font-variation-settings: "wdth" 110;
    margin-bottom: 20px;
  }
  .hero__chip { display: none; }
  .hero__bottom { flex-direction: column; align-items: flex-start; gap: 18px; }
  .hero__scroll { display: none; }
}

@media (max-width: 440px) {
  .hero__title {
    font-size: clamp(32px, 10vw, 42px);
  }
}

/* ==========================================================================
   Works
   ========================================================================== */
.works {
  position: relative;
  background: var(--bg);
  padding: clamp(80px, 10vw, 140px) 0 clamp(40px, 6vw, 80px);
}
.works__container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.works__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: clamp(28px, 4vw, 48px);
  flex-wrap: wrap;
}
.works__head-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.works__title {
  font-weight: 700;
  font-variation-settings: "wdth" 110;
  font-size: clamp(38px, 5.5vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.035em;
}
.works__controls {
  display: flex;
  align-items: center;
  gap: 24px;
}
.works__progress {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  color: var(--fg-dim);
}
.works__count b { color: var(--copper); font-weight: 500; }
.works__bar { width: 120px; height: 2px; background: var(--line); position: relative; overflow: hidden; border-radius: 2px; }
.works__bar i { position: absolute; inset: 0; background: var(--copper); transform-origin: left; transform: scaleX(0.166); transition: transform .4s var(--ease-out); }

.works__arrows {
  display: flex;
  gap: 10px;
}
.works__nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .25s var(--ease-out);
}
.works__nav-btn:hover:not(:disabled) {
  background: var(--copper);
  color: #0a0a09;
  border-color: var(--copper);
  transform: scale(1.06);
}
.works__nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.works__stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 6px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}
.works__track {
  display: flex;
  width: 100%;
  will-change: transform;
}
.work {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--bg-2);
}
.works__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}
.works__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: all .3s var(--ease-out);
}
.works__dot.is-active {
  background: var(--copper);
  transform: scale(1.3);
  width: 24px;
  border-radius: 99px;
}
.work__art {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(80% 80% at 50% 50%, rgba(226, 118, 58, 0.06), transparent 70%),
    #0d0d0b;
}
.work__art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.work__art-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.work__art-tag {
  position: relative;
  z-index: 2;
  color: var(--fg-dim);
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: auto;
  background: rgba(13, 13, 11, 0.7);
  backdrop-filter: blur(8px);
  padding: 5px 12px 5px 10px;
  border-radius: 99px;
  border: 1px solid rgba(235, 230, 220, 0.1);
  font-size: 11px;
}
.work__art-tag::before { content: ""; width: 6px; height: 6px; background: var(--copper); border-radius: 50%; }

.work__view-switch {
  pointer-events: auto;
  display: inline-flex;
  gap: 4px;
  background: rgba(13, 13, 11, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 3px;
}
.work__tab {
  background: transparent;
  border: 0;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 11px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.work__tab.is-active {
  background: var(--copper);
  color: #0a0a09;
  font-weight: 500;
}
.work__tab:hover:not(.is-active) {
  color: var(--fg);
  background: rgba(235, 230, 220, 0.08);
}
.work__tab .dot-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--copper);
  animation: pulse-dot 1.8s infinite;
}
.work__tab.is-active .dot-indicator {
  background: #0a0a09;
  animation: none;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.work__board-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.35s ease;
}

.work__photo-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  overflow: hidden;
  transition: opacity 0.35s ease;
}
.work__photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.work__photo-view:hover .work__photo-img {
  transform: scale(1.04);
}
.work__photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,9,0.2) 0%, rgba(10,10,9,0.1) 40%, rgba(10,10,9,0.88) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 22px;
  pointer-events: none;
}
.work__photo-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(226, 118, 58, 0.16);
  border: 1px solid var(--copper);
  color: var(--copper-hi);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.work__photo-caption {
  color: var(--fg-dim);
  font-size: 12px;
  letter-spacing: 0.01em;
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 40px);
  background: rgba(10, 10, 9, 0.94);
  backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0s; /* visible at once so the close button can take focus */
}
.lightbox__card {
  position: relative;
  max-width: 1100px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.85);
}
.lightbox__img {
  width: 100%;
  max-height: calc(92vh - 80px);
  object-fit: contain;
  background: #000;
  display: block;
}
.lightbox__bar {
  padding: 14px 20px;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.lightbox__caption {
  font-size: 13px;
  color: var(--fg-dim);
}
.lightbox__close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line-strong);
  color: var(--fg);
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  transition: background 0.2s, color 0.2s;
}
.lightbox__close:hover {
  background: var(--copper);
  color: #0a0a09;
}

.work__body { display: flex; flex-direction: column; gap: 18px; padding: 22px 22px 24px; }
.work__meta { display: flex; justify-content: space-between; color: var(--fg-dim); gap: 16px; }
.work__meta b { color: var(--copper); font-weight: 500; }
.work__title {
  font-weight: 700;
  font-variation-settings: "wdth" 112;
  font-size: clamp(28px, 3.1vw, 48px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.work__role { color: var(--fg-dim); font-size: 14px; margin-top: -8px; }
.work__desc { color: var(--fg-dim); font-size: 15px; line-height: 1.5; max-width: 52ch; }
.work__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.work__tags li {
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 5px 10px 4px;
  color: var(--fg);
}

/* SVG board art */
.board-outline { fill: #10100e; stroke: rgba(235, 230, 220, .18); stroke-width: 1; }
.board-grid { fill: rgba(235, 230, 220, .07); }
.trace { fill: none; stroke: #b5582a; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.trace--wide { stroke-width: 4; opacity: .55; }
.trace-pulse { fill: none; stroke: var(--copper-hi); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.pad { fill: #c9c2b4; }
.via { fill: #0d0d0b; stroke: #b5582a; stroke-width: 1.4; }
.part { fill: #1a1a17; stroke: rgba(235, 230, 220, .28); stroke-width: 1; }
.part--accent { stroke: var(--copper); }
.silk { fill: rgba(235, 230, 220, .55); font-family: var(--font-mono); font-size: 7px; letter-spacing: .06em; }
.silk--lg { font-size: 9px; fill: rgba(235, 230, 220, .8); }
.silk-line { fill: none; stroke: rgba(235, 230, 220, .35); stroke-width: .8; }
.hole { fill: var(--bg); stroke: rgba(235, 230, 220, .3); stroke-width: 1; }

.trace-pulse { stroke-dasharray: 9 91; animation: flow 2.4s linear infinite; animation-play-state: paused; transition: opacity .5s; }
.work:hover .trace-pulse, .work.is-active .trace-pulse { opacity: 1; animation-play-state: running; }
@keyframes flow { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }

@media (min-width: 900px) {
  .work {
    grid-template-rows: none;
    grid-template-columns: 1.45fr 1fr;
    min-height: 520px;
  }
  .work__art { aspect-ratio: auto; height: 100%; border-bottom: 0; border-right: 1px solid var(--line); }
  .work__body { padding: clamp(24px, 2.5vw, 40px); }
  .work__desc { font-size: clamp(14px, 1.05vw, 16px); }
}

.works__more {
  padding: clamp(56px, 8vw, 120px) var(--gutter) clamp(80px, 10vw, 140px);
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}
.works__more > p { color: var(--fg-dim); padding-top: 22px; }
.works__more li { border-top: 1px solid var(--line); }
.works__more li:last-child { border-bottom: 1px solid var(--line); }
.works__more a {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;
  padding: 20px 0;
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: padding .5s var(--ease-out), color .3s;
}
.works__more a em { font-style: normal; color: var(--muted); }
.works__more a:hover { padding-left: 16px; color: var(--copper); }
.arrow { display: inline-block; transition: transform .5s var(--ease-out); }
a:hover .arrow { transform: translate(3px, -3px); }

@media (max-width: 720px) {
  .works__head { grid-template-columns: 1fr; grid-template-areas: "label" "title"; }
  .works__progress { display: none; }
  .works__more { grid-template-columns: 1fr; }
  .works__more > p { padding-top: 0; }
  .works__more a { grid-template-columns: 1fr auto; gap: 4px 16px; }
  .works__more a em { grid-row: 2; }
  .works__more a .arrow { grid-row: 1 / span 2; grid-column: 2; }
}

/* ==========================================================================
   About (light)
   ========================================================================== */
.about {
  background: var(--paper);
  color: var(--ink);
  padding: clamp(80px, 12vw, 180px) 0 clamp(80px, 10vw, 140px);
  border-radius: clamp(16px, 2.4vw, 32px) clamp(16px, 2.4vw, 32px) 0 0;
  position: relative;
  z-index: 2;
}
.about .section-label { color: var(--ink-dim); }
.about .muted { color: var(--ink-dim); }
.about ::selection { background: var(--ink); color: var(--paper); }

/* About Profile (Photo + Bio) */
.about__profile {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 48px);
  margin-top: 36px;
  margin-bottom: clamp(40px, 6vw, 64px);
  align-items: start;
}
@media (min-width: 860px) {
  .about__profile {
    grid-template-columns: 340px 1fr;
    gap: 48px;
  }
}
@media (max-width: 859px) {
  .about__portrait {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
  }
}
.about__portrait {
  position: relative;
}
.about__portrait-frame {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(10, 10, 9, 0.15);
  background: #11110f;
  aspect-ratio: 4 / 4.8;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.09);
}
.about__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 18% 28%;
  filter: grayscale(8%) contrast(103%);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.6s ease;
  display: block;
}
.about__portrait-frame:hover .about__img {
  transform: scale(1.03);
  filter: grayscale(0%) contrast(100%);
}
.about__portrait-tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(13, 13, 11, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(235, 230, 220, 0.2);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.04em;
}
.about__portrait-tag .dot {
  width: 6px;
  height: 6px;
  background: var(--copper);
  border-radius: 50%;
}
.about__bio {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.about__bio-title {
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-variation-settings: "wdth" 110;
}
.about__bio-text {
  color: var(--ink-dim);
  font-size: 16px;
  line-height: 1.65;
}
.about__bio-text b {
  color: var(--ink);
}
.about__quick-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--ink-line);
}
.about__quick-meta > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.about__quick-meta .label {
  font-size: 11px;
  color: var(--copper);
  font-weight: 500;
}
.about__quick-meta span:last-child {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}

.about__statement {
  margin-top: 32px;
  font-weight: 500;
  font-variation-settings: "wdth" 96;
  font-size: clamp(26px, 3.8vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 1500px;
  text-indent: 2.2em;
}
.about__statement .w { opacity: 0.14; transition: none; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink-line);
  margin-top: clamp(64px, 8vw, 120px);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 20px 0 0;
  border-right: 1px solid var(--ink-line);
  margin-right: 20px;
}
.stat:last-child { border-right: 0; margin-right: 0; }
.stat__num {
  font-weight: 300;
  font-variation-settings: "wdth" 62;
  font-size: clamp(56px, 8vw, 140px);
  line-height: .85;
  letter-spacing: -0.04em;
}
.stat__label { color: var(--ink-dim); max-width: 26ch; line-height: 1.5; }

@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding-bottom: 28px; border-bottom: 1px solid var(--ink-line); }
  .stat:nth-child(2) { border-right: 0; margin-right: 0; }
  .stat:nth-child(3), .stat:nth-child(4) { border-bottom: 0; }
}

.h3 {
  font-weight: 700;
  font-variation-settings: "wdth" 110;
  font-size: clamp(26px, 2.8vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1;
}
.h3 em { font-style: italic; font-weight: 300; color: var(--ink-dim); }

/* Side-by-Side Tech Row: Pinout (Left Half) & Toolchain (Right Half) */
.about__tech-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 4vw, 56px);
  margin-top: clamp(64px, 8vw, 130px);
  align-items: stretch;
}
@media (min-width: 960px) {
  .about__tech-row {
    grid-template-columns: 1.05fr 1fr;
  }
}
.about__tech-col {
  display: flex;
  flex-direction: column;
}

/* Pinout Column */
.pinout { margin-top: 0; height: 100%; display: flex; flex-direction: column; }
.pinout__head, .toolchain-card__head, .sheet__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ink-line);
}
.pinout__body {
  display: grid;
  grid-template-columns: 1fr minmax(130px, 170px) 1fr;
  align-items: center;
  padding: clamp(24px, 3.5vw, 44px) 0;
  flex: 1;
}
.pins { display: grid; gap: 0; align-content: center; }
.pins li {
  position: relative;
  display: flex;
  align-items: center;
  height: 38px;
  font-weight: 600;
  font-variation-settings: "wdth" 105;
  font-size: clamp(13px, 1.1vw, 16px);
  letter-spacing: -0.01em;
  cursor: default;
  transition: color .3s;
}
.pins li::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ink);
  opacity: .35;
  transform-origin: var(--origin);
  transform: scaleX(var(--draw, 1));
  transition: opacity .3s, background-color .3s, height .3s;
}
.pins--left li { --origin: right; }
.pins--left li::after { margin-left: 12px; order: 2; }
.pins--right li { --origin: left; justify-content: flex-end; flex-direction: row-reverse; }
.pins--right li::after { margin-right: 12px; }
.pins li::before {
  content: "";
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--ink);
  top: 50%;
  margin-top: -3px;
  transition: background-color .3s, transform .3s;
}
.pins--left li::before { right: -3px; }
.pins--right li::before { left: -3px; }
.pins li:hover, .pins li.is-on { color: var(--copper); }
.pins li:hover::after, .pins li.is-on::after { background: var(--copper); opacity: 1; height: 2px; }
.pins li:hover::before, .pins li.is-on::before { background: var(--copper); transform: scale(1.4); }

.ic {
  position: relative;
  container-type: inline-size;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
}
.ic__notch { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(235, 230, 220, .4); }
.ic__name {
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  font-size: clamp(26px, 24cqi, 48px); /* sized to the chip: its column gets narrow next to the toolchain */
  letter-spacing: -0.04em;
  line-height: .9;
  margin-top: auto;
}
.ic__desc { color: rgba(235, 230, 220, .55); margin-top: 8px; line-height: 1.5; font-size: 11px; }
.ic__readout { color: var(--copper); margin-top: 14px; min-height: 2.2em; line-height: 1.4; font-size: 11px; }

@media (max-width: 640px) {
  .pinout__body { grid-template-columns: 1fr 1fr; gap: 0 0; }
  .ic { grid-column: 1 / -1; grid-row: 1; min-height: 180px; margin-bottom: 20px; }
  .pins li { height: 34px; font-size: 13px; }
  .pins--left li::before, .pins--right li::before { display: none; }
  .pins--right li { flex-direction: row; justify-content: flex-start; }
  .pins--right li::after { margin-right: 0; margin-left: 12px; order: 2; }
  .pins--right { padding-left: 12px; }
  .pins--left { padding-right: 12px; }
  .pins li::after { --origin: left; }
}

/* Toolchain Column */
.toolchain-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.tools--side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 24px;
  border-top: 0;
  padding: clamp(24px, 3.5vw, 44px) 0;
  flex: 1;
}
.tools ul { margin-top: 14px; display: grid; gap: 4px; }
.tools li { font-size: clamp(16px, 1.3vw, 20px); font-weight: 500; letter-spacing: -0.015em; }
@media (max-width: 500px) { .tools--side { grid-template-columns: 1fr; gap: 24px; } }

/* Sheet */
.sheet { margin-top: clamp(80px, 11vw, 180px); }
.sheet__rows { counter-reset: row; }
.sheet__rows li {
  position: relative;
  display: grid;
  grid-template-columns: 160px minmax(180px, 1fr) 1.6fr;
  gap: 24px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--ink-line);
  transition: padding .5s var(--ease-out);
}
.sheet__rows li > .mono { color: var(--ink-dim); }
.sheet__rows b { font-weight: 700; font-variation-settings: "wdth" 108; font-size: clamp(20px, 2vw, 30px); letter-spacing: -0.02em; line-height: 1.05; }
.sheet__rows li > span:last-child { color: var(--ink-dim); font-size: 16px; }
.sheet__rows li::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .7s var(--ease-out);
}
.sheet__rows li:hover::before { transform: scaleX(1); }
.sheet__rows li:hover { padding-left: 12px; }
@media (max-width: 720px) {
  .sheet__rows li { grid-template-columns: 1fr; gap: 6px; padding: 18px 0; }
}

/* Facts */
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 96px);
  margin-top: clamp(80px, 10vw, 160px);
}
.facts h4 { padding-bottom: 14px; border-bottom: 1px solid var(--ink-line); }
.facts h4 + ul { margin-bottom: 48px; }
.facts li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--ink-line); align-items: baseline; }
.facts li b { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.facts li span { color: var(--ink-dim); text-align: right; }
.facts .facts__col:first-child li { flex-direction: column; gap: 4px; }
.facts .facts__col:first-child li span { text-align: left; font-size: 14px; }
.facts .langs li { flex-direction: row !important; }
.press {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  margin-top: 32px;
  padding: 22px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
  transition: background-color .4s;
}
.press .muted { color: rgba(235, 230, 220, .5) !important; grid-column: 1 / -1; }
.press b { font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.press:hover { background: var(--copper); }
.press:hover .muted { color: var(--ink) !important; }
@media (max-width: 720px) {
  .facts { grid-template-columns: 1fr; }
  .facts li { flex-direction: column; gap: 4px; }
  .facts li span { text-align: left; }
  .facts .langs li { flex-direction: column !important; }
}

/* ==========================================================================
   Contact + footer
   ========================================================================== */
.contact {
  position: relative;
  background: var(--bg);
  padding-top: clamp(96px, 14vw, 200px);
  overflow: hidden;
}
.contact__title {
  margin-top: 28px;
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  font-size: clamp(52px, 11.5vw, 220px);
  line-height: 0.86;
  letter-spacing: -0.045em;
}
.contact__mail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: clamp(48px, 7vw, 96px);
  padding: 28px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.mail-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 500;
  font-variation-settings: "wdth" 90;
  font-size: clamp(24px, 4.4vw, 68px);
  letter-spacing: -0.03em;
  line-height: 1.1;
  position: relative;
  word-break: break-all;
}
.mail-link__text { position: relative; }
.mail-link__text::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.02em;
  height: 2px;
  background: var(--copper);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .6s var(--ease-out);
}
.mail-link:hover .mail-link__text::after { transform: scaleX(1); transform-origin: left; }
.mail-link__arrow { color: var(--copper); transition: transform .5s var(--ease-out); }
.mail-link:hover .mail-link__arrow { transform: translateX(10px); }

.copy-btn {
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 14px 22px 13px;
  transition: background-color .3s, color .3s, border-color .3s;
}
.copy-btn:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.copy-btn.is-copied { background: var(--copper); border-color: var(--copper); color: var(--bg); }

.socials { display: grid; grid-template-columns: repeat(3, 1fr); }
.socials li { border-bottom: 1px solid var(--line); }
.socials li:not(:nth-child(3n+1)) { border-left: 1px solid var(--line); }
.socials a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 26px 22px;
  transition: background-color .4s, color .4s;
}
.socials li:nth-child(3n+1) a { padding-left: 0; }
.socials a .mono { color: var(--muted); }
.socials b { font-weight: 600; font-size: clamp(20px, 2vw, 30px); letter-spacing: -0.02em; }
.socials a:hover { color: var(--copper); }
@media (max-width: 720px) {
  .socials { grid-template-columns: 1fr; }
  .socials li:not(:nth-child(3n+1)) { border-left: 0; }
  .socials a { padding: 22px 0; }
}

.footer { margin-top: clamp(80px, 10vw, 140px); }
.marquee { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; }
.marquee__inner {
  display: flex;
  width: max-content;
  gap: 0.5em;
  font-weight: 300;
  font-variation-settings: "wdth" 62;
  font-size: clamp(40px, 7vw, 120px);
  letter-spacing: -0.03em;
  line-height: 1;
  animation: marquee 30s linear infinite;
  will-change: transform;
}
.marquee__inner span:nth-of-type(odd) { font-style: italic; }
.marquee__inner i { font-style: normal; color: var(--copper); }
@keyframes marquee { to { transform: translateX(-50%); } }
.footer__bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px var(--gutter) max(22px, env(safe-area-inset-bottom));
  color: var(--fg-dim);
}
.footer__top:hover { color: var(--copper); }
@media (max-width: 720px) {
  .footer__bar { flex-wrap: wrap; }
  .footer__mid { order: 3; width: 100%; }
}

/* ==========================================================================
   Blog Section (Medium Articles)
   ========================================================================== */
.blog {
  position: relative;
  background: var(--bg);
  padding: clamp(80px, 10vw, 150px) 0;
  border-top: 1px solid var(--line);
}
.blog__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.blog__title {
  font-weight: 700;
  font-variation-settings: "wdth" 110;
  font-size: clamp(38px, 5.5vw, 76px);
  line-height: 0.95;
  letter-spacing: -0.035em;
}
.blog__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 99px;
  border: 1px solid var(--copper);
  background: rgba(226, 118, 58, 0.1);
  color: var(--copper);
  font-size: 13px;
  transition: all 0.25s var(--ease-out);
}
.blog__btn:hover {
  background: var(--copper);
  color: #0a0a09;
}
.blog__btn .arrow {
  transition: transform 0.25s ease;
}
.blog__btn:hover .arrow {
  transform: translate(3px, -3px);
}
.blog__lead {
  font-size: clamp(16px, 1.2vw, 19px);
  color: var(--fg-dim);
  max-width: 65ch;
  line-height: 1.6;
  margin-bottom: clamp(36px, 5vw, 56px);
}
.blog__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 820px) {
  .blog__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.blog__card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: clamp(24px, 3vw, 36px);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.blog__card:hover {
  transform: translateY(-4px);
  border-color: var(--copper);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}
.blog__meta {
  display: flex;
  justify-content: space-between;
  color: var(--copper);
  font-size: 11px;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.blog__card-title {
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.blog__card-desc {
  color: var(--fg-dim);
  font-size: 14px;
  line-height: 1.6;
  flex: 1;
}
.blog__card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.blog__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.blog__tag {
  color: var(--muted);
  font-size: 12px;
}

/* ==========================================================================
   Products (reuses the blog card styles)
   ========================================================================== */
.products__grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 820px) { .products__grid { grid-template-columns: repeat(2, 1fr); } }
.product--featured { grid-column: 1 / -1; padding: 0; gap: 0; overflow: hidden; }
.product--wide { grid-column: 1 / -1; }
.product__thumb { margin: calc(-1 * clamp(24px, 3vw, 36px)) calc(-1 * clamp(24px, 3vw, 36px)) 0; border-bottom: 1px solid var(--line); border-radius: 6px 6px 0 0; overflow: hidden; background: #000; }
.product__thumb img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: left top; }
.product__shot { display: block; background: #000; border-bottom: 1px solid var(--line); }
.product__shot img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.product__body { display: flex; flex-direction: column; gap: 16px; padding: clamp(24px, 3vw, 36px); }
@media (min-width: 960px) {
  .product--featured { display: grid; grid-template-columns: 1.4fr 1fr; }
  .product__shot { border-bottom: 0; border-right: 1px solid var(--line); }
}
.product__facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 500px) { .product__facts { grid-template-columns: repeat(2, 1fr); } }
.product__facts b { display: block; font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--fg); letter-spacing: -0.02em; }
.product__facts span { font-size: 10px; color: var(--muted); letter-spacing: 0.05em; }
.product__links { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 12px; }
.product__links a { color: var(--copper); }
.product__links .arrow { display: inline-block; transition: transform 0.25s ease; }
.product__links a:hover .arrow { transform: translate(3px, -3px); }

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .grain, .marquee__inner, .hero__scroll-line i, .nav__dot { animation: none; }
  .about__statement .w { opacity: 1; }
}
