@import url('https://fonts.googleapis.com/css2?family=Felipa&family=JetBrains+Mono:wght@400;500&family=Manrope:wght@300;400;500;600;700;800&family=Merriweather:wght@400;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@latest/dist/tabler-icons.min.css');

:root {
  /* SHARED BRAND AND UI COLOURS */
  --primary: #934eae;
  --primary-dark: #9624a8;
  --secondary: #0d6f87;
  --secondary-dark: #0d6178;
  --status-current: #0d6f87;
  --status-planned: #a04400;
  --on-color: #ffffff;
  --code-bg: #111827;
  --code-border: #374151;
  --code-text: #d1d5db;
  --code-muted: #9ca3af;
  --terminal-red: #f87171;
  --terminal-yellow: #fbbf24;
  --terminal-green: #34d399;
  --linkedin: #0a66c2;
  --github: #181717;

  /* Typography */
  --font-heading: "Merriweather", serif;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Manrope", sans-serif;
  --font-code: "JetBrains Mono", monospace;
  --font-accent: "Felipa", cursive;

  /* LIGHT THEME */
  --bg-top: #a8cde5;
  --bg-middle: #8fc9cc;
  --bg-bottom: #91c6ae;

  --bg: #f7fbfc;
  --surface: #f1f3f5;
  --surface-hover: #dfe4e8;
  --surface-subtle: #e7eaed;
  --text: #102333;
  --muted: #526b7a;
  --on-primary: #ffffff;
  --border: #c5ccd2;
  --header-bg: #ffffff;
  --header-border: #b9d5dc;
  --header-text: #102333;

}

/* DARK MODE */
:root[data-theme="dark"] {
  /* DARK THEME */
  --bg-top: #0a2238;
  --bg-middle: #103d45;
  --bg-bottom: #174333;

  --bg: #0b1726;
  --surface: #172b36;
  --surface-hover: #23464a;
  --surface-subtle: #1d3943;

  --text: #e6f4f7;
  --muted: #a1b9bb;
  --secondary: #49b8c7;
  --status-current: #49b8c7;
  --status-planned: #f59e0b;

  --on-primary: #ffffff;
  --border: #2b4d4c;
  --header-bg: #000000;
  --header-border: #26333d;
  --header-text: #e6f4f7;
}

/* DARK MODE: SYSTEM PREFERENCE FALLBACK */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    /* DARK THEME */
    --bg-top: #0a2238;
    --bg-middle: #103d45;
    --bg-bottom: #174333;

    --bg: #0b1726;
    --surface: #172b36;
    --surface-hover: #23464a;
    --surface-subtle: #1d3943;

    --text: #e6f4f7;
    --muted: #a1b9bb;
    --secondary: #49b8c7;
    --status-current: #49b8c7;
    --status-planned: #f59e0b;

    --on-primary: #ffffff;
    --border: #2b4d4c;
    --header-bg: #000000;
    --header-border: #26333d;
    --header-text: #e6f4f7;
  }
}

/* CONTINUOUS PAGE GRADIENT */
:root[data-theme="dark"] body {
  background: linear-gradient(
    to bottom,
    var(--bg-top) 0%,
    var(--bg-middle) 52%,
    var(--bg-bottom) 100%
  );
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) body {
    background: linear-gradient(
      to bottom,
      var(--bg-top) 0%,
      var(--bg-middle) 52%,
      var(--bg-bottom) 100%
    );
  }
}

* {
  box-sizing: border-box;
  --header-height: 80px;
}

html {
  scroll-behavior: smooth;
  scroll-margin-top: var(--header-height);
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;

  background: linear-gradient(
    to bottom,
    var(--bg-top) 0%,
    var(--bg-middle) 48%,
    var(--bg-bottom) 100%
  );
}

.container {
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: 2.5rem;
}

/* ==========================
   NAVBAR
========================== */

.nav-toggle {
  display: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 80px;
  background: var(--header-bg);
  color: var(--header-text);
  border-bottom: 1px solid var(--header-border);
  backdrop-filter: blur(8px);
}

.site-header .container {
  width: 100%;
  max-width: none;
  padding-inline: 2.5rem;
}

.nav-wrapper {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.header-brand-group {
  display: flex;
  align-items: center;
  gap: 3rem;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--header-text);
  text-decoration: none;
  font-weight: 500;
}

.brand img {
  display: block;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  margin-left: -0.35rem;
  object-fit: contain;
}

.tagline {
  font-family: var(--font-accent);
  font-size: 1.2rem;
  font-weight: 500;
  white-space: nowrap;
  margin: 0;
  position: relative;
  top: 2px;
}

.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
}

.nav-list a {
  text-decoration: none;
  color: var(--header-text);
  font-size: 0.95rem;
  padding: 0.45rem 0.65rem;
  border-radius: 0.5rem;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  background: var(--surface-hover);
  color: var(--secondary-dark);
}

:root[data-theme="dark"] .nav-list a:hover,
:root[data-theme="dark"] .nav-list a:focus-visible {
  color: var(--header-text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--header-text);
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  background: var(--surface-hover);
  color: var(--header-text);
}

:root[data-theme="light"] .theme-toggle:hover,
:root[data-theme="light"] .theme-toggle:focus-visible {
  color: var(--secondary-dark);
}

.theme-toggle i {
  font-size: 1.25rem;
  line-height: 1;
}

/* ==========================
   CODE BLOCKS
========================== */
code,
pre {
  font-family: var(--font-code);
}

/* ==========================
   SECTION LAYOUT
========================== */

.section {
  min-height: calc(100vh - var(--header-height));
  padding-block: 2.5rem;
  scroll-margin-top: var(--header-height);
}

.hero {
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
}

#resume,
#contact {
  display: flex;
  align-items: center;
}

.section-label,
.visiting-card-label,
.resume-card-label {
  color: var(--secondary);
}

h1,
h2,
h3 {
  margin-top: 0;
  line-height: 1.2;
}

h2 {
  font-family: var(--font-heading);
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin-bottom: 1rem;
}

.lead {
  max-width: 62ch;
  color: var(--muted);
}

/* ==========================
   HERO LAYOUT
========================== */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: center;
  gap: 5rem;
}

.hero-content {
  min-width: 0;
  max-width: 760px;
}

.hero-content h1 {
  margin-top: 0;
  margin-bottom: 2rem;
}

.hero-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@media (min-width: 769px) {
  .hero-visual {
    position: relative;
    left: 3rem;
  }
}

.hero-tagline {
  max-width: 62ch;
}

/* Hero Code Tagline */

.hero-code-tagline {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  margin: 1rem 0 0;
  padding: 2rem 0.9rem 0.7rem;
  border: 1px solid var(--code-border);
  border-radius: 0.45rem;
  background: var(--code-bg);
  color: var(--code-text);
  font-family: var(--font-code);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.hero-code-tagline::before {
  content: "TERMINAL";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  padding: 0.35rem 0.75rem 0.35rem 3rem;
  border-bottom: 1px solid var(--code-border);
  color: var(--code-muted);
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: left;
}

.hero-code-tagline::after {
  content: "";
  position: absolute;
  top: 0.62rem;
  left: 0.75rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--terminal-red);
  box-shadow: 0.75rem 0 var(--terminal-yellow), 1.5rem 0 var(--terminal-green);
}

.hero-code-prompt,
.hero-code-cursor {
  color: var(--secondary);
}

.hero-code-cursor {
  color: var(--secondary);
  margin-left: 0.1rem;
  animation: hero-cursor-blink 0.9s steps(1) infinite;
}

@keyframes hero-cursor-blink {
  50% {
    opacity: 0;
  }
}

.hero-visual-frame {
  width: min(380px, 100%);
  aspect-ratio: 1 / 1;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-visual-image {
  display: block;
  width: 68%;
  height: 68%;
  object-fit: contain;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Logo Flip Transform */

.hero-visual-frame {
  perspective: 1000px;
}

.hero-visual-image {
  display: block;
  width: 68%;
  height: 68%;
  object-fit: contain;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
}

.hero-visual-frame:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.10);
}

.hero-visual-frame:hover .hero-visual-image {
  transform: rotateY(360deg) scale(1.02);
}

/* ==========================
   CARDS
========================== */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.card h3,
.card h4 {
  font-family: var(--font-display);
}

.planned {
  color: var(--muted);
  font-style: italic;
}

/* ==========================
   ABOUT SECTION GRID
========================== */

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.about-grid .card {
  position: relative;
  overflow: hidden;
  border-top: 3px solid var(--secondary);
}

.about-card-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  font-size: 8rem;
  color: var(--secondary);
  opacity: 0.15;

  pointer-events: none;
}

.about-grid .card h3,
.about-grid .card p {
  position: relative;
  z-index: 1;
}

/* ==========================
   CERTIFICATIONS
========================== */

.cert-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  justify-content: center;
}

.cert-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 320px;
  gap: 0.25rem;
  border-top: 3px solid var(--secondary);
}

.certification-card.planned {
  border-inline-start: 3px solid var(--status-planned);
  background: var(--surface-subtle);
  color: var(--muted);
}

.certification-card.planned h4,
.certification-card.planned p {
  color: var(--muted);
}

.cert-card h4 {
  margin-bottom: 0.25rem;
}

.cert-card p {
  margin: 0;
}

.cert-card .button {
  margin-top: 0.75rem;
  align-self: center;
}

.cert-badge {
  width: 150px;
  height: 150px;
  object-fit: contain;
  margin-bottom: 0.5rem;
  align-self: center;
}

.cert-date {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ==========================
   BUTTONS
========================== */

.button {
  display: inline-block;
  border: none;
  border-radius: 0.7rem;
  background: var(--primary);
  color: var(--on-primary);
  text-decoration: none;
  padding: 0.65rem 1rem;
  font-weight: 600;
  cursor: pointer;
}

.button:hover,
.button:focus-visible {
  background: var(--primary-dark);
}

/* ==========================
   PROJECTS
========================== */

.planned-projects {
  margin-top: 1.5rem;
  font-style: italic;
  color: var(--muted);
}

.projects-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  align-items: start;
}

.project-item {
  border: 1px solid var(--border);
  border-top: 3px solid var(--secondary);
  border-radius: 0.9rem;
  background: var(--surface);
  overflow: hidden;
}

.project-summary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem 1.75rem;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.project-summary:hover {
  background: var(--surface-subtle);
}

.project-summary:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: -2px;
}

.project-summary-content {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 0.5rem;
}

.project-year {
  font-family: var(--font-code);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
}

.project-base {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
  margin: 0;
}

.project-type,
.project-status,
.project-detail-label,
.planned-project-status {
  margin: 0;
  font-family: var(--font-code);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-type {
  color: var(--secondary);
}

.project-status {
  color: var(--status-current);
}

.project-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.project-focus {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.project-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
}

.project-toggle i {
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.project-summary[aria-expanded="true"] .project-toggle i {
  transform: rotate(180deg);
}

.project-details-content .button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  margin: 2rem auto 0;
}

.project-details {
  border-top: 1px solid var(--border);
}

.project-details-content {
  max-width: 850px;
  padding: 1.5rem 1.75rem 1.75rem;
}

.project-details-content>p:first-child {
  margin-top: 0;
  line-height: 1.7;
  color: var(--muted);
}

.project-detail-group {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 6.5rem;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid var(--border);
}

.project-detail-label {
  color: var(--muted);
}

.project-detail-value {
  line-height: 1.6;
}

.project-details-content .button {
  margin-top: 1.5rem;
}


/* ==========================
   PLANNED PROJECTS
========================== */

.projects-planned {
  margin-top: 3rem;
}

.planned-projects {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, 1fr);
}

.planned-project {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 1.25rem;
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--status-planned);
  border-radius: 0.75rem;
  background: var(--surface-subtle);
  color: var(--muted);
}

.planned-project-status {
  color: var(--status-planned);
}

.projects-planned .section-label {
  color: var(--status-planned);
}

.planned-project-name {
  color: var(--muted);
  font-weight: 600;
}

.planned-project-focus {
  font-size: 0.9rem;
}

/* ==========================
   BLOGS
========================== */

.blog-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 164px;
  align-items: center;
  gap: 1.5rem;

  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--secondary);
  border-radius: 1rem;
  overflow: hidden;
  padding: 0 1.25rem 0 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.blog-card:hover {
  background: var(--surface-subtle);
  border-color: var(--secondary);
}

.blog-image {
  width: 100%;
  height: 100%;
  min-height: 150px;
  align-self: stretch;
  object-fit: cover;
  object-position: center;
  display: block;
}

.blog-content {
  min-width: 0;
  padding-block: 1rem;
}

.blog-category {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--secondary);
  text-transform: uppercase;
}

.blog-title {
  margin: 0 0 0.45rem;
  max-width: 34rem;
  font-size: 1.35rem;
  line-height: 1.3;
}

.blog-description {
  margin: 0;
  max-width: 65ch;
  color: var(--muted);
  line-height: 1.55;
}

.blog-grid {
  display: grid;
  gap: 2rem;
}

.blog-action {
  width: 100%;
  justify-self: end;
  white-space: nowrap;
}

/* ==========================
   RESUME
========================== */

.resume-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 4rem;
  align-items: start;
}

.resume-content {
  max-width: 680px;
}

.resume-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.resume-highlights {
  display: grid;
  gap: 1.25rem;
  margin-top: 2rem;
}

/* Left side */

.resume-content h2 {
  margin-bottom: 1rem;
}

.resume-intro {
  max-width: 60ch;
  line-height: 1.7;
  color: var(--muted);
}

.resume-highlight {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.resume-highlight h3 {
  margin-bottom: 0.45rem;
  font-size: 1rem;
}

.resume-highlight p {
  margin: 0;
  line-height: 1.65;
  color: var(--muted);
}

/* Right Side */

/* Digital visiting card */
.visiting-card {
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
}

.visiting-card-header {
  margin-bottom: 2.5rem;
}

.visiting-card-label,
.resume-card-label {
  font-family: var(--font-code);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.visiting-card-body h3 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
}

.visiting-card-body p:first-of-type {
  margin: 0 0 1rem;
  font-family: var(--font-accent);
  font-size: 1.05rem;
}

.visiting-card-body p:last-of-type {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

/* Resume card */
.resume-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
}

.resume-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.resume-card-format {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  font-family: var(--font-code);
  font-size: 0.7rem;
}

.resume-card-body h3 {
  margin: 0 0 0.5rem;
}

.resume-card-body p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

.resume-card-action {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.resume-card-action a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.9rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
}

.resume-card-action a:first-child {
  background: var(--primary);
  color: var(--on-primary);
}

.resume-card-action a:first-child:hover,
.resume-card-action a:first-child:focus-visible {
  background: var(--primary-dark);
}

.resume-card-action a:last-child {
  border: 1px solid var(--border);
  color: var(--text);
}

.resume-card-action a:last-child:hover,
.resume-card-action a:last-child:focus-visible {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--on-color);
}

/* ==========================
   CONTACT
========================== */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 4rem;
  align-items: center;
}

.contact-content {
  max-width: 680px;
}

.contact-content p {
  line-height: 1.7;
}

.contact-links {
  display: grid;
  gap: 1rem;
}

/* Contact cards */

.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 90px;
  padding: 1.25rem 1.5rem;
  border-radius: 0.9rem;
  text-decoration: none;
  color: var(--on-color);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.contact-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon i {
  font-size: 50px;
  line-height: 1;
}

.contact-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.contact-card-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.contact-card-description {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* Individual contact colours */

.contact-linkedin {
  background: var(--linkedin);
}

.contact-github {
  background: var(--github);
}

.contact-email {
  background: var(--primary);
}

/* Interaction */

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.contact-card:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 3px;
}

/* ==========================
   FOOTER
========================== */

.site-footer {
  background: var(--header-bg);
  color: var(--header-text);
  border-top: 1px solid var(--header-border);
}

.site-footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--header-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--secondary);
}

/* ==========================
   TABLET LAYOUT
   769px–1024px
========================== */

@media (min-width: 769px) and (max-width: 1024px) {

  .site-header .container {
    padding-inline: 1.5rem;
    position: relative;
  }

  .nav-wrapper {
    gap: 0.75rem;
  }

  .header-brand-group {
    display: contents;
  }

  .brand {
    margin-right: auto;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
  }

  .theme-toggle {
    margin-left: 0;
    width: 2.75rem;
    height: 2.75rem;
  }

  .nav-toggle i {
    font-size: 1.5rem;
    line-height: 1;
  }

  .site-header nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 1.5rem;
    width: min(320px, calc(100% - 3rem));
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  }

  .site-header nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0;
  }

  .nav-list a {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: 0;
  }

  .nav-list li + li {
    border-top: 1px solid var(--border);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 2rem;
  }

  .hero-visual {
    left: 0;
  }

  .hero-visual-frame {
    width: min(300px, 100%);
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions .button {
    width: min(100%, 24rem);
  }

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

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

  .projects-list,
  .planned-projects {
    grid-template-columns: 1fr;
  }

  .project-detail-group {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .blog-card {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }

  .blog-image {
    width: 100%;
    height: 180px;
    min-height: 0;
  }

  .blog-content {
    width: 100%;
    padding: 1.25rem;
  }

  .blog-title,
  .blog-description {
    max-width: none;
  }

  .blog-action {
    justify-self: center;
    width: min(100% - 2.5rem, 20rem);
    margin: 0 auto 1.25rem;
    text-align: center;
  }
}

/* ==========================
   MOBILE LAYOUT
   0px–768px
========================== */

@media (max-width: 768px) {

  :root {
    --header-height: 76px;
  }

  html,
  body {
    width: 100%;
    overflow-x: clip;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .site-header .container {
    width: 100%;
    max-width: none;
    padding-inline: 0.75rem;
    position: relative;
  }


  .nav-wrapper {
    justify-content: flex-start;
    gap: clamp(0.75rem, 3vw, 1.25rem);
  }

  .brand {
    min-width: 0;
    flex: 0 1 auto;
  }

  .header-brand-group {
    flex: 1 1 auto;
    min-width: 0;
  }

  .brand img {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
    flex-shrink: 0;
    margin-left: -0.35rem;
  }

  .tagline {
    font-size: 1.125rem;
    margin-left: 0.1rem;
  }

  .nav-toggle {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 35px;
    height: 35px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
  }

  .theme-toggle {
    margin-left: 0;
  }

  .nav-toggle i {
    font-size: 1.5rem;
    line-height: 1;
  }

  .site-header nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);

  }

  .site-header nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0;
    margin: 0;
    padding: 0.5rem 0;
  }

  .nav-list a {
    display: block;
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 0;
  }

  .nav-list li {
    width: 100%;
  }

  .nav-list li+li {
    border-top: 1px solid var(--border);
  }

  .nav-list a.is-pressed {
    background: var(--surface-hover);
    color: var(--secondary-dark);
  }

  .nav-toggle:active {
    background: var(--surface-hover);
    color: var(--secondary-dark);
  }


  /* General layout */
  .about-grid,
  .cert-grid,
  .resume-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }

  .lead {
    font-size: 1rem;
  }

  .cert-badge {
    width: 130px;
    height: 130px;
  }

  .section {
    padding: 3rem 0;
  }

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

  .hero-content {
    display: contents;
  }

  .hero-content h1 {
    grid-row: 1;
  }

  .hero-visual {
    grid-row: 2;
    align-items: center;
  }

  .hero-content .hero-tagline {
    grid-row: 3;
    margin-bottom: 0.25rem;
  }

  .hero-content .lead {
    grid-row: 4;
    margin-top: 0.25rem;
  }

  .hero-content .hero-actions {
    grid-row: 5;
  }

  .hero-visual-frame {
    width: min(320px, 85vw);
  }

  .hero-visual-image {
    width: 72%;
    height: 72%;
  }

  .hero-code-tagline {
    text-align: center;
    white-space: normal;
    font-size: 0.75rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .hero-actions .button {
    width: 100%;
    text-align: center;
  }

  .hero-visual-image.is-spinning {
    animation: hero-coin-spin 0.8s ease;
  }

  .projects-list {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .project-summary {
    gap: 1rem;
    padding: 1.25rem;
  }

  .project-title {
    font-size: 1.2rem;
  }

  .project-toggle {
    width: 2.25rem;
    height: 2.25rem;
  }

  .project-details-content {
    padding: 1.25rem;
  }

  .project-detail-group {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .planned-projects {
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0;
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .blog-card {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }

  .blog-title {
    max-width: none;
    font-size: 1.2rem;
  }

  .blog-image {
    width: 100%;
    height: 140px;
    min-height: 0;
  }

  .blog-content {
    padding: 1rem;
  }

  .blog-description {
    max-width: 100%;
  }

  .blog-action {
    justify-self: start;
    margin: 0 1rem 1rem;
  }

  .blog-action.button {
    width: calc(100% - 2rem);
    text-align: center;
  }

  .site-footer-content {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    padding-block: 1rem;
  }
}

@keyframes hero-coin-spin {
  from {
    transform: rotateY(0deg);
  }

  to {
    transform: rotateY(360deg);
  }
}