/* ============================================
   TOKENS
   ============================================ */
:root {
  --bg: #11131a;
  --surface: #171a21;
  --surface-2: #1d212a;
  --border: #262b35;
  --text: #eef0f3;
  --text-muted: #8b93a1;
  --text-faint: #565d6b;

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --diocese-1: #034dc6;
  --diocese-2: #fdd327;
  --glass-1: #b8326d;
  --glass-2: #e575a7;
  --term: #2fdc8f;

  --radius: 14px;
  --max: 1160px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  margin: 0;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 14px;
}

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

/* ============================================
   LAYOUT HELPERS
   ============================================ */
main,
header.nav,
footer.footer {
  position: relative;
  z-index: 1;
}

section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 110px 40px;
}

.section-head {
  max-width: 620px;
  margin-bottom: 56px;
}
.section-head h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 600;
}

/* ============================================
   NAV
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 40px;
  background: rgba(17, 19, 26, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav__logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.nav__logo-dot {
  color: var(--diocese-2);
}

.nav__links {
  display: flex;
  gap: 32px;
}
.nav__links a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav__links a:hover {
  color: var(--text);
}

.nav__social {
  display: flex;
  gap: 16px;
}
.nav__social a {
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav__social a:hover {
  color: var(--text);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  gap: 60px;
  align-items: center;
  padding-top: 100px;
  padding-bottom: 100px;
}

.hero__title {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 600;
  line-height: 1.12;
  margin-bottom: 22px;
}
.hero__title-em {
  color: var(--diocese-2);
}

.hero__body {
  max-width: 480px;
  color: var(--text-muted);
  font-size: 17px;
  margin-bottom: 34px;
}

.hero__cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  letter-spacing: 0.02em;
  transition:
    transform 0.15s ease,
    background 0.2s,
    border-color 0.2s;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--text);
  color: var(--bg);
}
.btn--primary:hover {
  background: var(--diocese-2);
}

.btn--ghost {
  border-color: var(--border);
  color: var(--text);
}
.btn--ghost:hover {
  border-color: var(--text-muted);
}

.btn--full {
  width: 100%;
}

/* Hero swatch signature */
.hero__swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.swatch-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.swatch-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.swatch-row--mono .swatch-label {
  color: var(--term);
}

.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent);
}

.swatch-dot--term {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--term);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--term) 25%, transparent);
}

.swatch-label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
}

.hero__swatch-caption {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  margin: 0;
}

/* ============================================
   WORK TILES
   ============================================ */
.work__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.work__grid .tile--terminal {
  grid-column: 1 / -1;
}

.tile {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.tile:hover {
  transform: translateY(-3px);
}

.tile__logo {
  position: absolute;
  top: 56px;
  right: 24px;
  width: 72px;
  height: 72px;
  object-fit: contain;
  opacity: 0.92;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.25));
  pointer-events: none;
}

@media (max-width: 480px) {
  .tile__logo {
    width: 52px;
    height: 52px;
    top: 50px;
    right: 18px;
  }
}

.tile__chrome {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.tile__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}
.tile__url {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-left: 8px;
}

.tile__body {
  padding: 28px;
}
.tile__role {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
  opacity: 0.75;
}
.tile__title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}
.tile__desc {
  font-size: 14.5px;
  margin-bottom: 20px;
  opacity: 0.88;
  max-width: 46ch;
}

.tile__tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 22px;
}
.tile__tags li {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.tile__link {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

/* Diocese theme */
.tile--diocese {
  background: linear-gradient(155deg, var(--diocese-1) 0%, #022f7a 100%);
  color: #f4f7ff;
}
.tile--diocese .tile__title {
  color: var(--diocese-2);
}
.tile--diocese .tile__tags li {
  background: rgba(253, 211, 39, 0.16);
  color: var(--diocese-2);
}
.tile--diocese .tile__link {
  color: var(--diocese-2);
}

/* Cubed Glass theme */
.tile--glass {
  background: linear-gradient(155deg, var(--glass-1) 0%, #6d1b41 100%);
  color: #fff0f6;
}
.tile--glass .tile__title {
  color: var(--glass-2);
}
.tile--glass .tile__tags li {
  background: rgba(229, 117, 167, 0.2);
  color: var(--glass-2);
}
.tile--glass .tile__link {
  color: var(--glass-2);
}

/* Terminal / software theme */
.tile--terminal {
  background: #0b0d0a;
  color: #d8ffe9;
  border-color: rgba(47, 220, 143, 0.25);
}
.tile__chrome--term {
  background: rgba(47, 220, 143, 0.06);
  border-bottom-color: rgba(47, 220, 143, 0.15);
}
.tile--terminal .tile__url {
  color: var(--term);
  font-weight: 500;
}
.tile--terminal .tile__title {
  color: var(--term);
  font-family: var(--font-mono);
}
.tile--terminal .tile__body {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 24px 32px;
  align-items: start;
}
.tile--terminal .tile__role,
.tile--terminal .tile__title,
.tile--terminal .tile__desc {
  grid-column: 1;
}
.tile__diagram {
  grid-column: 2;
  grid-row: 1 / span 4;
  justify-self: end;
  width: 100%;
  max-width: 260px;
}
.tile__tags--term {
  grid-column: 1;
}
.tile__link--term {
  grid-column: 1;
}
.tile__tags--term li {
  background: rgba(47, 220, 143, 0.12);
  color: var(--term);
}

@media (max-width: 720px) {
  .tile--terminal .tile__body {
    grid-template-columns: 1fr;
  }
  .tile__diagram {
    grid-column: 1;
    grid-row: auto;
    max-width: 100%;
    margin-bottom: 8px;
  }
}

/* ============================================
   CV / EXPERIENCE
   ============================================ */
.cv__intro {
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 15.5px;
  max-width: 56ch;
}

.cv__columns {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
}

.cv__col-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--term);
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.cv__col-label--spaced {
  margin-top: 32px;
}

.cv__timeline {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.cv__item {
  position: relative;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--term);
  border-radius: var(--radius);
}

.cv__item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.cv__item-head h3 {
  font-size: 17px;
  font-weight: 600;
}
.cv__dates {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
}

.cv__org {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.cv__desc {
  font-size: 14.5px;
  color: var(--text-muted);
  margin: 0;
  max-width: 52ch;
}

.cv__plain {
  font-size: 15px;
  font-weight: 500;
  margin: 0;
}

@media (max-width: 780px) {
  .cv__columns {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ============================================
   SKILLS
   ============================================ */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.skills__group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.skills__label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin: 0 0 16px;
}

.skills__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skills__list li {
  font-size: 15px;
  font-weight: 500;
}

/* ============================================
   CONTACT
   ============================================ */
.contact__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
}

.contact__info {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.contact__row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.2s;
}
a.contact__row:hover {
  opacity: 0.75;
}
.contact__row--static {
  cursor: default;
}

.contact__label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}
.contact__value {
  font-size: 17px;
  font-weight: 500;
}

.contact__social {
  display: flex;
  gap: 24px;
  margin-top: 22px;
}
.contact__social a {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.contact__social a:hover {
  color: var(--text);
}

.contact__form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}
.field input,
.field textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--diocese-2);
}

.form-status {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  min-height: 16px;
  margin: 0;
}
.form-status[data-state="success"] {
  color: var(--term);
}
.form-status[data-state="error"] {
  color: var(--glass-2);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 40px;
  text-align: center;
}
.footer p {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  margin: 0;
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 60px;
  }
  .work__grid {
    grid-template-columns: 1fr;
  }
  .work__grid .tile--terminal {
    grid-column: auto;
  }
  .skills__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact__grid {
    grid-template-columns: 1fr;
  }
  .nav__links {
    display: none;
  }
}

@media (max-width: 560px) {
  section {
    padding: 70px 22px;
  }
  .nav {
    padding: 18px 22px;
  }
  .skills__grid {
    grid-template-columns: 1fr;
  }
}
