:root {
  color-scheme: dark;
  --bg: #171820;
  --surface: #20212b;
  --line: #343542;
  --text: #f2f3f8;
  --muted: #a6a8b8;
  --indigo: #2e2a74;
  --blue-bright: #8794ff;
  --content: 1120px;
  --radius: 15px;

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

/* --- Base & Reset --- */

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

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

a:focus-visible,
button:focus-visible,
.nav-toggle:focus-visible + .menu-toggle {
  outline: 3px solid var(--blue-bright);
  outline-offset: 4px;
  border-radius: 4px;
}

::selection {
  background: var(--indigo);
  color: #fff;
}

/* --- Layout & Utilities --- */

.container {
  width: min(var(--content), calc(100% - 48px));
  margin-inline: auto;
}

.section {
  padding: 112px 0;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 10px 14px;
  background: #5365d6;
  color: #fff;
  border-radius: 7px;
}

.skip-link:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow,
.panel-topline,
.panel-label,
.hero-foot,
.project-meta,
.timeline-date,
.skill-number,
.visual-caption {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* --- Header & Navigation --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(23, 24, 32, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--indigo);
  color: #fff;
  font-size: 11px;
  letter-spacing: -0.04em;
}

.brand-name {
  font-size: 15px;
}

.brand-dot,
.accent-text {
  color: var(--blue-bright);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 30px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.primary-nav a:hover,
.hero-links a:hover,
.contact-socials a:hover {
  color: var(--blue-bright);
}

.primary-nav .nav-contact {
  color: var(--text);
  border: 1px solid var(--line);
  padding: 9px 13px;
  border-radius: 7px;
}

.menu-toggle {
  display: none;
}

/* --- Buttons --- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--indigo);
  color: #fff;
  border: 1px solid #46419a;
}

.button-primary:hover {
  background: #3a358c;
}

.button-secondary {
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
}

.button-secondary:hover {
  border-color: var(--blue-bright);
}

/* --- Hero --- */

.hero {
  padding-top: 112px;
  padding-bottom: 30px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 72px;
  align-items: center;
  min-height: 460px;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--blue-bright);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #7cc6a1;
  border-radius: 50%;
  margin-right: 9px;
}

h1 {
  margin-bottom: 24px;
  font-size: clamp(42px, 5.4vw, 68px);
  line-height: 1.12;
  letter-spacing: -0.065em;
  font-weight: 800;
}

.hero-intro {
  max-width: 650px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-links {
  display: flex;
  gap: 22px;
  margin-top: 35px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.hero-panel {
  min-height: 370px;
  position: relative;
  overflow: hidden;
  padding: 23px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.panel-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
}

.panel-indicator {
  color: #83c8a4;
}

.panel-monogram {
  position: relative;
  z-index: 1;
  font-size: clamp(110px, 17vw, 190px);
  font-weight: 800;
  letter-spacing: -0.12em;
  line-height: 1;
  color: #34365a;
}

.panel-monogram span {
  color: var(--blue-bright);
}

.panel-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.panel-bottom div {
  display: grid;
  gap: 5px;
}

.panel-label {
  font-size: 9px;
}

.panel-bottom strong {
  font-size: 12px;
  line-height: 1.5;
}

.panel-decoration {
  position: absolute;
  width: 220px;
  height: 220px;
  right: -70px;
  top: 80px;
  border: 1px solid #424477;
  border-radius: 50%;
  box-shadow:
          0 0 0 28px rgba(46, 42, 116, 0.12),
          0 0 0 58px rgba(46, 42, 116, 0.08);
}

.hero-foot {
  display: flex;
  justify-content: space-between;
  padding-top: 42px;
  font-size: 9px;
}

/* --- About --- */

.about-section {
  background: #1b1c25;
  border-block: 1px solid rgba(255, 255, 255, 0.05);
}

.two-column {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 90px;
}

.section-heading h2,
.section-title-row h2 {
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.055em;
  margin: 0;
}

.about-copy {
  color: var(--muted);
  font-size: 14px;
}

.about-copy .lead {
  color: var(--text);
  font-size: 18px;
  line-height: 1.8;
}

.about-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 38px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.about-facts div {
  display: grid;
  gap: 5px;
}

.fact-value {
  color: var(--blue-bright);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.fact-label {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

/* --- Projects --- */

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 30px;
  margin-bottom: 48px;
}

.section-aside {
  max-width: 290px;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 13px;
}

.project-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.project-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 22px;
}

.project-visual {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #22243b;
}

.callingpoint-visual {
  background: #22243b;
}

.mock-app {
  width: 225px;
  min-height: 300px;
  padding: 12px;
  background: #11131c;
  border: 1px solid #51536b;
  border-radius: 23px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.4);
  transform: rotate(-4deg);
}

.mock-status {
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: #d7d9e5;
}

.mock-app-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 15px 0 17px;
}

.mock-logo {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.06em;
}

.mock-logo span {
  color: #8d9aff;
}

.mock-avatar {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: #34376d;
  border-radius: 50%;
  font-size: 9px;
}

.mock-greeting {
  font-size: 9px;
  color: #9da1b4;
}

.mock-station {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
}

.mock-departure {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 10px 8px;
  margin-bottom: 7px;
  border-radius: 8px;
  background: #242637;
}

.mock-departure b {
  display: block;
  font-size: 9px;
}

.mock-departure small {
  display: block;
  color: #a6a9bd;
  font-size: 7px;
}

.mock-departure strong {
  font-size: 11px;
}

.mock-departure span {
  grid-column: 1 / -1;
  color: #9da5ff;
  font-size: 7px;
}

.mock-tabbar {
  display: flex;
  justify-content: space-around;
  padding-top: 10px;
}

.mock-tabbar i {
  width: 12px;
  height: 3px;
  background: #53577e;
  border-radius: 4px;
}

.visual-caption {
  position: absolute;
  bottom: 18px;
  left: 20px;
  font-size: 8px;
}

.project-content {
  padding: 34px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.project-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 9px;
}

.project-status {
  color: #83c8a4;
}

.project-content h3 {
  margin: 23px 0 5px;
  font-size: 27px;
  line-height: 1.25;
  letter-spacing: -0.05em;
}

.project-subtitle {
  color: var(--blue-bright) !important;
  font-weight: 700;
}

.project-content p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

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

.tag-list li {
  padding: 5px 9px;
  background: #2a2b3a;
  border: 1px solid #3a3b4c;
  border-radius: 5px;
  color: #c5c8db;
  font-size: 9px;
  font-weight: 700;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: auto;
  font-size: 11px;
  font-weight: 800;
}

.project-links a {
  color: var(--blue-bright);
}

.project-links a:hover {
  color: #fff;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.project-small .project-visual {
  min-height: 230px;
}

.project-small .project-content {
  min-height: 340px;
  padding: 26px;
}

.project-small .project-content h3 {
  font-size: 21px;
  margin-top: 17px;
}

.project-small .project-content p {
  font-size: 12px;
}

/* Phishing Detector Mock UI */

.phishing-visual {
  background: #202b32;
}

.scan-window {
  width: min(82%, 350px);
  padding: 15px;
  background: #171e25;
  border: 1px solid #42515b;
  border-radius: 9px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.scan-top {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #aeb9c1;
  font: 8px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.scan-top span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #64757d;
}

.scan-top b {
  margin-left: auto;
  letter-spacing: 0.1em;
}

.scan-url {
  margin: 20px 0 12px;
  padding: 9px;
  border: 1px solid #46525a;
  border-radius: 5px;
  color: #d7dce1;
  font: 9px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow-wrap: anywhere;
}

.scan-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  background: #382c30;
  border: 1px solid #71434b;
  border-radius: 6px;
}

.warning-symbol {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #9a5158;
  font-weight: 800;
}

.scan-result b,
.scan-result small {
  display: block;
}

.scan-result b {
  font-size: 9px;
}

.scan-result small {
  color: #c6aeb2;
  font-size: 8px;
}

.scan-meter {
  height: 4px;
  margin-top: 14px;
  background: #35434a;
  border-radius: 5px;
}

.scan-meter i {
  display: block;
  width: 82%;
  height: 100%;
  background: #bd747b;
  border-radius: inherit;
}

.scan-foot {
  display: block;
  margin-top: 10px;
  color: #91a0a7;
  font: 7px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Audiobook Mock UI */

.audiobook-visual {
  background: #2a2942;
}

.audio-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  width: min(85%, 340px);
  background: #20212e;
  border: 1px solid #45435f;
  border-radius: 10px;
}

.audio-cover {
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 112px;
  flex: 0 0 auto;
  background: #393778;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.05em;
}

.audio-cover b {
  position: absolute;
  right: 6px;
  bottom: 5px;
  color: #aeb7ff;
  font-size: 10px;
}

.audio-info {
  min-width: 0;
}

.audio-info b,
.audio-info small {
  display: block;
}

.audio-info b {
  font-size: 10px;
}

.audio-info small {
  color: var(--muted);
  font-size: 8px;
}

.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 30px;
  margin-top: 13px;
}

.waveform i {
  width: 3px;
  height: 30%;
  background: #8794ff;
  border-radius: 4px;
}

.waveform i:nth-child(3n) {
  height: 85%;
}

.waveform i:nth-child(3n + 1) {
  height: 55%;
}

.waveform i:nth-child(4n) {
  height: 100%;
}

/* More Projects Banner */

.more-projects {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
  padding: 28px 30px;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.more-projects .eyebrow {
  margin-bottom: 8px;
  font-size: 9px;
}

.more-projects h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.more-projects p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

/* --- Experience --- */

.experience-section {
  background: #1b1c25;
  border-block: 1px solid rgba(255, 255, 255, 0.05);
}

.timeline {
  border-top: 1px solid var(--line);
}

.timeline-item {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 25px;
  padding: 25px 0;
  border-bottom: 1px solid var(--line);
}

.timeline-date {
  padding-top: 5px;
  font-size: 9px;
}

.timeline-item h3 {
  margin: 0 0 3px;
  font-size: 17px;
  letter-spacing: -0.03em;
}

.timeline-org {
  margin: 0 0 10px;
  color: var(--blue-bright) !important;
  font-size: 11px !important;
  font-weight: 700;
}

.timeline-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

/* --- Skills --- */

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.skill-group {
  min-height: 210px;
  padding: 24px;
  border-right: 1px solid var(--line);
}

.skill-group:last-child {
  border-right: 0;
}

.skill-number {
  color: var(--blue-bright);
}

.skill-group h3 {
  margin: 18px 0 13px;
  font-size: 16px;
}

.skill-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 11px;
}

.skill-group li {
  margin: 5px 0;
}

/* --- Contact & Footer --- */

.contact-section {
  background: #1b1c25;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.contact-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-inner .eyebrow {
  margin-bottom: 22px;
}

.contact-inner h2 {
  margin: 0;
  font-size: clamp(37px, 5vw, 58px);
  line-height: 1.15;
  letter-spacing: -0.06em;
}

.contact-copy {
  max-width: 470px;
  margin: 22px 0 27px;
  color: var(--muted);
  font-size: 13px;
}

.contact-button {
  min-height: 52px;
}

.contact-socials {
  display: flex;
  gap: 25px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 10px;
}

.footer-inner .brand {
  color: var(--text);
}

/* --- Responsive: Tablet --- */

@media (max-width: 850px) {
  .section {
    padding: 82px 0;
  }

  .hero {
    padding-top: 75px;
  }

  .hero-grid {
    grid-template-columns: 1fr 0.7fr;
    gap: 30px;
  }

  .hero-panel {
    min-height: 320px;
  }

  .two-column {
    gap: 45px;
  }

  .project-content {
    padding: 25px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .skill-group:nth-child(2) {
    border-right: 0;
  }

  .skill-group:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

/* --- Responsive: Mobile --- */

@media (max-width: 650px) {
  .container {
    width: min(100% - 36px, var(--content));
  }

  .header-inner {
    min-height: 66px;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
  }

  .menu-icon,
  .menu-icon::before,
  .menu-icon::after {
    display: block;
    width: 17px;
    height: 2px;
    background: currentColor;
    position: relative;
    transition: transform 0.18s ease, background-color 0.18s ease, top 0.18s ease;
  }

  .menu-icon::before,
  .menu-icon::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .menu-icon::before {
    top: -6px;
  }

  .menu-icon::after {
    top: 6px;
  }

  .nav-toggle:checked ~ .primary-nav {
    display: flex;
  }

  .nav-toggle:checked + .menu-toggle .menu-icon {
    background: transparent;
  }

  .nav-toggle:checked + .menu-toggle .menu-icon::before {
    top: 0;
    transform: rotate(45deg);
  }

  .nav-toggle:checked + .menu-toggle .menu-icon::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .primary-nav {
    display: none;
    position: absolute;
    top: 65px;
    left: 0;
    right: 0;
    padding: 15px 18px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .primary-nav a {
    padding: 12px 5px;
  }

  .primary-nav .nav-contact {
    margin-top: 7px;
    text-align: center;
  }

  .hero {
    padding-top: 65px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  h1 {
    font-size: clamp(39px, 11vw, 56px);
  }

  .hero-intro {
    font-size: 14px;
  }

  .hero-panel {
    min-height: 275px;
  }

  .panel-monogram {
    font-size: 125px;
  }

  .hero-foot {
    font-size: 8px;
    padding-top: 30px;
  }

  .two-column {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .section-heading h2,
  .section-title-row h2 {
    font-size: 37px;
  }

  .about-facts {
    gap: 10px;
  }

  .fact-label {
    font-size: 9px;
  }

  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 30px;
  }

  .section-aside {
    margin: 0;
  }

  .project-featured,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-visual {
    min-height: 275px;
  }

  .project-featured .project-visual {
    min-height: 310px;
  }

  .project-small .project-visual {
    min-height: 225px;
  }

  .project-small .project-content {
    min-height: 0;
  }

  .more-projects {
    align-items: flex-start;
    flex-direction: column;
    padding: 23px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 21px 0;
  }

  .timeline-date {
    font-size: 8px;
  }

  .skills-grid {
    grid-template-columns: 1fr 1fr;
  }

  .skill-group {
    min-height: 190px;
    padding: 18px;
  }

  .skill-group h3 {
    font-size: 14px;
  }

  .skill-group ul {
    font-size: 10px;
  }

  .footer-inner {
    padding: 20px 0;
    flex-wrap: wrap;
  }

  .footer-inner > span:nth-child(2) {
    display: none;
  }
}

/* --- Reduced Motion --- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}