:root {
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --black: #000;
  --white: #fff;
  --n-50: #fafafa;
  --n-100: #f5f5f5;
  --n-200: #e5e5e5;
  --n-300: #d4d4d4;
  --n-400: #a3a3a3;
  --n-500: #737373;
  --n-800: #262626;
  --red-600: #dc2626;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-feature-settings: "liga" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--white);
  color: var(--black);
  overscroll-behavior-y: none;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.bg-glow {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 500px;
  width: 500px;
  border-radius: 9999px;
  background: rgba(229, 229, 229, 0.5);
  filter: blur(100px);
  z-index: -1;
  pointer-events: none;
}

.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.section {
  padding: 80px 24px;
  max-width: 72rem;
  margin: 0 auto;
  width: 100%;
}

.section--hero {
  padding: 48px 24px 80px;
}

.section--footer {
  padding: 40px 24px;
}

@media (min-width: 640px) {
  .section {
    padding: 112px 40px;
  }
  .section--hero {
    padding: 80px 40px 128px;
  }
  .section--footer {
    padding: 40px 40px;
  }
}

@media (min-width: 1024px) {
  .section {
    padding-left: 64px;
    padding-right: 64px;
  }
  .section--hero {
    padding-left: 64px;
    padding-right: 64px;
  }
  .section--footer {
    padding-left: 64px;
    padding-right: 64px;
  }
}

.divider {
  width: 100%;
  border-top: 1px solid var(--n-200);
}

/* ─── HERO ─── */
.hero {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

@media (min-width: 640px) {
  .hero {
    gap: 56px;
  }
}

.hero-topbar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 640px) {
  .hero-topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 28px;
  width: auto;
  opacity: 0.9;
}

.brand-name {
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--black);
}

.hero-headline {
  margin: 0;
  max-width: 64rem;
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5.5vw, 4.5rem);
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--black);
  font-weight: 700;
}

.hero-headline-muted {
  color: var(--n-300);
}

.hero-footer {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@media (min-width: 640px) {
  .hero-footer {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.hero-sub {
  margin: 0;
  font-size: 14px;
  color: var(--n-500);
  max-width: 28rem;
  line-height: 1.625;
  font-weight: 300;
}

@media (min-width: 640px) {
  .hero-sub {
    font-size: 16px;
  }
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: background-color 0.3s;
  flex-shrink: 0;
  cursor: pointer;
}

.btn--primary {
  background: var(--black);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--n-800);
}

.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn .icon--arrow {
  transition: transform 0.3s;
}

.btn:hover .icon--arrow {
  transform: translateX(4px);
}

/* ─── SECTION LABEL ─── */
.section-label {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
}

@media (min-width: 640px) {
  .section-label {
    margin-bottom: 64px;
  }
}

.section-label > span {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--n-400);
}

.section-label-line {
  flex: 1;
  height: 1px;
  background: var(--n-200);
}

/* ─── GRIDS ─── */
.grid {
  display: grid;
  grid-template-columns: 1fr;
}

.grid--bordered {
  background: var(--n-200);
  gap: 1px;
}

@media (min-width: 640px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ─── CELL ─── */
.cell {
  background: var(--white);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: background-color 0.3s;
  height: 100%;
}

@media (min-width: 640px) {
  .cell {
    padding: 32px;
  }
}

.cell--lg {
  gap: 24px;
}

@media (min-width: 1024px) {
  .cell--lg {
    padding: 40px;
  }
}

.cell:hover {
  background: var(--n-50);
}

.cell-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.cell-top-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cell-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.cell-number {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--n-300);
}

.cell-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cell-title--project {
  font-size: 12px;
  color: var(--n-800);
  transition: color 0.3s;
}

.cell:hover .cell-title--project {
  color: var(--black);
}

.cell-desc {
  margin: 0;
  font-size: 14px;
  color: var(--n-500);
  line-height: 1.625;
}

.cell-desc--sm {
  font-size: 12px;
}

.tag {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--n-400);
  padding: 2px 8px;
  border: 1px solid var(--n-200);
}

.cell-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

@media (min-width: 1024px) {
  .cell-link--wide {
    grid-column: span 3;
  }
}

.cell .icon {
  color: var(--n-400);
  transition: color 0.3s;
}

.cell:hover .icon {
  color: var(--black);
}

.icon--ext {
  width: 12px;
  height: 12px;
  color: var(--n-400);
  transition: color 0.3s;
}

.cell:hover .icon--ext {
  color: var(--black);
}

/* ─── OSS ─── */
.oss {
  border: 1px solid var(--n-200);
  padding: 24px;
  transition: background-color 0.3s;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 640px) {
  .oss {
    padding: 32px;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

@media (min-width: 1024px) {
  .oss {
    padding: 40px;
  }
}

.oss:hover {
  background: var(--n-50);
}

.oss-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.oss-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--black);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s;
  width: fit-content;
}

.oss-link:hover {
  color: var(--n-500);
}

.oss-desc {
  margin: 0;
  font-size: 14px;
  color: var(--n-500);
  line-height: 1.625;
  max-width: 28rem;
}

/* ─── COPY BUTTON ─── */
.copy-btn {
  position: relative;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: -0.025em;
  background: transparent;
  padding: 4px 10px;
  border-radius: 2px;
  border: 1px solid var(--n-200);
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.copy-btn:hover {
  background: var(--n-50);
}

.copy-btn-label {
  color: var(--n-500);
  transition: opacity 0.2s;
}

.copy-btn-confirm {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s;
  background: var(--n-50);
  color: #171717;
}

.copy-btn.is-copied .copy-btn-label {
  opacity: 0;
}

.copy-btn.is-copied .copy-btn-confirm {
  opacity: 1;
}

/* ─── CONTACT ─── */
.contact-intro {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.contact-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 4vw, 3rem);
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--black);
  font-weight: 700;
}

.contact-sub {
  margin: 0;
  font-size: 14px;
  color: var(--n-500);
  max-width: 28rem;
  line-height: 1.625;
}

/* ─── FOOTER ─── */
.section--footer {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (min-width: 640px) {
  .section--footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 32px;
}

.footer-link {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--n-500);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-link:hover {
  color: var(--black);
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--n-400);
}

/* ─── ICONS ─── */
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.icon--sm {
  width: 18px;
  height: 18px;
}

.icon--arrow {
  width: 14px;
  height: 14px;
}

.icon--tiny {
  width: 10px;
  height: 10px;
}

/* ─── ANIMATIONS ─── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.32, 0.72, 0.3, 1) both;
}

main > .section.fade-in:nth-of-type(1) { animation-delay: 0s; }
main > .section.fade-in:nth-of-type(2) { animation-delay: 0.05s; }
main > .section.fade-in:nth-of-type(3) { animation-delay: 0.1s; }
main > .section.fade-in:nth-of-type(4) { animation-delay: 0.15s; }
main > .section.fade-in:nth-of-type(5) { animation-delay: 0.2s; }
main > .section.fade-in:nth-of-type(6) { animation-delay: 0.25s; }
main > .section.fade-in:nth-of-type(7) { animation-delay: 0.3s; }

.link-animated {
  position: relative;
  text-decoration: none;
}

.link-animated::after {
  content: "";
  position: absolute;
  width: 100%;
  transform: scaleX(0);
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: currentColor;
  transform-origin: bottom right;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0.3, 1);
}

.link-animated:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 4px;
}
