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

:root {
  --bg: #0b0d10;
  --bg-elev: #121518;
  --bg-elev-2: #161a1f;
  --border: #222831;
  --border-strong: #2c333d;
  --text: #e6e9ef;
  --text-muted: #9aa3b2;
  --text-dim: #6b7280;
  --accent: #7aa2ff;
  --accent-soft: rgba(122, 162, 255, 0.12);
  --accent-strong: #a4bcff;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset,
    0 12px 30px -18px rgba(0, 0, 0, 0.6);
  --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 24px 50px -22px rgba(0, 0, 0, 0.7);
  --maxw: 1120px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background-image: radial-gradient(
      1200px 600px at 80% -10%,
      rgba(122, 162, 255, 0.07),
      transparent 60%
    ),
    radial-gradient(
      900px 500px at -10% 30%,
      rgba(122, 162, 255, 0.05),
      transparent 60%
    );
  background-attachment: fixed;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 160ms var(--ease);
}

a:hover,
a:focus-visible {
  color: var(--accent-strong);
}

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

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #0b0d10;
  padding: 8px 12px;
  font-weight: 600;
  border-radius: 0 0 8px 0;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* ----------------------------------------------------------------------- */
/*  Layout                                                                 */
/* ----------------------------------------------------------------------- */

.section {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 96px 28px;
}

.section--alt {
  background: linear-gradient(180deg, transparent, var(--bg-elev) 30%, var(--bg-elev) 70%, transparent);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  max-width: none;
  margin: 0;
}

.section--alt > * {
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
}

.section--cta {
  padding-bottom: 120px;
}

.section__head {
  max-width: 720px;
  margin-bottom: 56px;
}

.section__head--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.section__eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section__title {
  margin: 0 0 16px;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section__lede {
  margin: 0;
  color: var(--text-muted);
  font-size: 17px;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 16, 0.7);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.nav__brand:hover,
.nav__brand:focus-visible {
  color: var(--text);
}

.nav__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  transition: box-shadow 200ms var(--ease);
}

.nav__brand:hover .nav__dot,
.nav__brand:focus-visible .nav__dot {
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.nav__brand-text {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--text-muted);
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__menu a {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  position: relative;
}

.nav__menu a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -6px;
  height: 2px;
  background: var(--accent);
  transition: right 220ms var(--ease);
}

.nav__menu a:hover,
.nav__menu a:focus-visible {
  color: var(--text);
}

.nav__menu a:hover::after,
.nav__menu a:focus-visible::after {
  right: 0;
}

.nav__toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  position: relative;
}

.nav__toggle span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 200ms var(--ease), opacity 200ms var(--ease), top 200ms var(--ease);
}

.nav__toggle span:nth-child(1) { top: 13px; }
.nav__toggle span:nth-child(2) { top: 19px; }
.nav__toggle span:nth-child(3) { top: 25px; }

.nav__toggle[aria-expanded="true"] span:nth-child(1) {
  top: 19px;
  transform: rotate(45deg);
}
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) {
  top: 19px;
  transform: rotate(-45deg);
}

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

.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 140px 28px 96px;
}

.hero__inner {
  max-width: 880px;
}

.hero__eyebrow {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.hero__title {
  margin: 0 0 24px;
  font-size: clamp(34px, 5.5vw, 60px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero__accent {
  background: linear-gradient(135deg, var(--accent), #b9c8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lede {
  margin: 0 0 36px;
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--text-muted);
  max-width: 640px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 44px;
}

.hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.hero__chips li {
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-elev);
}

/* ----------------------------------------------------------------------- */
/*  Buttons                                                                */
/* ----------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 160ms var(--ease), background 160ms var(--ease),
    border-color 160ms var(--ease), color 160ms var(--ease);
  text-decoration: none;
  will-change: transform;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  color: #0b0d10;
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--accent-strong);
  color: #0b0d10;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  background: var(--bg-elev);
  border-color: var(--accent);
  color: var(--text);
}

/* ----------------------------------------------------------------------- */
/*  Grids                                                                  */
/* ----------------------------------------------------------------------- */

.grid {
  display: grid;
  gap: 20px;
}

.grid--expertise {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--work {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* ----------------------------------------------------------------------- */
/*  Cards (expertise)                                                      */
/* ----------------------------------------------------------------------- */

.card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 220ms var(--ease), border-color 220ms var(--ease),
    background 220ms var(--ease);
  box-shadow: var(--shadow-1);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(122, 162, 255, 0.08), transparent 40%);
  opacity: 0;
  transition: opacity 220ms var(--ease);
  pointer-events: none;
}

.card:hover,
.card:focus-within {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--bg-elev-2);
}

.card:hover::before,
.card:focus-within::before {
  opacity: 1;
}

.card__icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 18px;
}

.card__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.card__body {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 15px;
}

/* ----------------------------------------------------------------------- */
/*  Work cards                                                             */
/* ----------------------------------------------------------------------- */

.work {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px 26px;
  transition: transform 220ms var(--ease), border-color 220ms var(--ease),
    background 220ms var(--ease);
  box-shadow: var(--shadow-1);
}

.work:hover,
.work:focus-within {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--bg-elev-2);
}

.work__num {
  margin: 0 0 16px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.work__title {
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.work__body {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 15px;
}

/* ----------------------------------------------------------------------- */
/*  Tag list                                                               */
/* ----------------------------------------------------------------------- */

.tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-list li {
  padding: 4px 10px;
  font-size: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.tag-list--sm li {
  font-size: 11.5px;
  padding: 3px 8px;
}

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

.contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  max-width: 820px;
  margin: 0 auto;
}

.contact__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 22px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: transform 200ms var(--ease), border-color 200ms var(--ease),
    background 200ms var(--ease);
  box-shadow: var(--shadow-1);
}

a.contact__item:hover,
a.contact__item:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--bg-elev-2);
  color: var(--text);
}

.contact__item--static {
  cursor: default;
}

.contact__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.contact__value {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 28px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

/* ----------------------------------------------------------------------- */
/*  Back-to-top                                                            */
/* ----------------------------------------------------------------------- */

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elev-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  text-decoration: none;
  box-shadow: var(--shadow-2);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease),
    background 220ms var(--ease), border-color 220ms var(--ease);
  z-index: 40;
}

.to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.to-top:hover,
.to-top:focus-visible {
  background: var(--accent);
  color: #0b0d10;
  border-color: var(--accent);
}

/* ----------------------------------------------------------------------- */
/*  Reveal animation                                                       */
/* ----------------------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ----------------------------------------------------------------------- */
/*  Responsive                                                             */
/* ----------------------------------------------------------------------- */

@media (max-width: 720px) {
  .section,
  .hero,
  .nav {
    padding-left: 20px;
    padding-right: 20px;
  }

  .section {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .hero {
    padding-top: 96px;
  }

  .nav__toggle {
    display: inline-flex;
  }

  .nav__menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    padding: 8px 20px 16px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 240ms var(--ease), padding 240ms var(--ease);
  }

  .nav__menu.is-open {
    max-height: 320px;
    padding-top: 8px;
    padding-bottom: 16px;
  }

  .nav__menu li {
    border-top: 1px solid var(--border);
  }

  .nav__menu a {
    display: block;
    padding: 14px 0;
  }

  .nav__menu a::after {
    display: none;
  }
}
