/* Portfolio — desktop-first shell + ~5% teal/cyan accents + light/dark themes */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-elevated: #0a0a0a;
  --shell-bg: rgba(0, 0, 0, 0.72);
  --text-primary: #f5f5f5;
  --text-heading: #e5e5e5;
  --text-muted: #737373;
  --text-soft: #a3a3a3;
  --text-dim: #a1a1a1;
  --border: #262626;
  --border-hover: #404040;
  --chip-bg: #1a1a1a;
  --chip-hover: #141414;
  --section-title-bg: #1c1c1c;
  --card-bg: rgba(23, 23, 23, 0.45);
  --media-bg: #171717;
  --placeholder-a: #0a0a0a;
  --placeholder-b: #111111;
  --logo-grad-a: #141414;
  --logo-grad-b: #0a0a0a;
  --view-all-bg: #171717;
  --code-bg: #0f0f0f;
  --blog-arrow: #333333;
  --selection-bg: rgba(45, 212, 191, 0.28);
  --selection-text: #f0fdfa;
  --glow-top: rgba(45, 212, 191, 0.08);
  --glow-side: rgba(20, 184, 166, 0.04);
  --glow-side-2: rgba(45, 212, 191, 0.035);
  --shadow-card: rgba(0, 0, 0, 0.35);

  /* ~5% teal / cyan accents */
  --accent: #2dd4bf;
  --accent-soft: #14b8a6;
  --accent-dim: rgba(45, 212, 191, 0.12);
  --accent-border: rgba(45, 212, 191, 0.35);
  --accent-glow: rgba(45, 212, 191, 0.08);
  --accent-text: #5eead4;

  --max-w: 72rem;
  --px: 2.5rem;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7f7;
  --bg-elevated: #ffffff;
  --shell-bg: rgba(255, 255, 255, 0.88);
  --text-primary: #0a1212;
  --text-heading: #14201f;
  --text-muted: #5c6b6a;
  --text-soft: #3d4a49;
  --text-dim: #4a5756;
  --border: #d0dcd9;
  --border-hover: #a8bbb8;
  --chip-bg: #e8f2f0;
  --chip-hover: #dceae7;
  --section-title-bg: #e6f0ee;
  --card-bg: rgba(255, 255, 255, 0.85);
  --media-bg: #eef4f3;
  --placeholder-a: #e8f0ee;
  --placeholder-b: #f5f9f8;
  --logo-grad-a: #f0faf8;
  --logo-grad-b: #e2f0ed;
  --view-all-bg: #eef5f3;
  --code-bg: #e6f0ee;
  --blog-arrow: #b0c4c1;
  --selection-bg: rgba(13, 148, 136, 0.22);
  --selection-text: #042f2e;
  --glow-top: rgba(20, 184, 166, 0.12);
  --glow-side: rgba(45, 212, 191, 0.08);
  --glow-side-2: rgba(13, 148, 136, 0.06);
  --shadow-card: rgba(15, 60, 55, 0.08);

  --accent: #0d9488;
  --accent-soft: #0f766e;
  --accent-dim: rgba(13, 148, 136, 0.1);
  --accent-border: rgba(13, 148, 136, 0.35);
  --accent-glow: rgba(13, 148, 136, 0.1);
  --accent-text: #0f766e;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--glow-top), transparent 55%),
    radial-gradient(ellipse 40% 30% at 100% 50%, var(--glow-side), transparent 50%),
    radial-gradient(ellipse 40% 30% at 0% 80%, var(--glow-side-2), transparent 50%);
  background-attachment: fixed;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("../background.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

[data-theme="light"] body::before {
  opacity: 0.2;
}

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

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

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

/* Shell — wide desktop column */
.shell {
  position: relative;
  z-index: 0;
  margin: 0 auto;
  min-height: 100vh;
  max-width: var(--max-w);
  border-left: 1px dashed var(--border);
  border-right: 1px dashed var(--border);
  padding: 0 var(--px);
  background-color: var(--shell-bg);
  box-shadow: 0 0 0 1px var(--accent-glow);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Header */
.header {
  display: flex;
  height: 4.75rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--logo-grad-a) 0%, var(--logo-grad-b) 100%);
  border: 1px solid var(--accent-border);
  box-shadow: 0 0 16px var(--accent-dim);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--accent-text);
  flex-shrink: 0;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.3s;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px dashed var(--border);
  border-radius: 2px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.25s, background 0.25s, border-color 0.25s, box-shadow 0.25s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent-text);
  box-shadow: 0 0 12px var(--accent-dim);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* Show sun in dark mode (click → light), moon in light mode (click → dark) */
.theme-toggle .icon-sun {
  display: none;
}
.theme-toggle .icon-moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}
[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}
[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

.logo:hover .logo-mark {
  border-color: var(--accent);
  box-shadow: 0 0 22px rgba(45, 212, 191, 0.22);
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  border: 1px dashed var(--border);
  padding: 0.4rem 0.85rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  transition: color 0.25s, background 0.25s, border-color 0.25s, box-shadow 0.25s;
  border-radius: 2px;
}

.nav-link:hover {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent-text);
}

.nav-link.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 0 12px var(--accent-dim);
}

/* Hero — roomy on PC */
.hero {
  padding: 3rem 0 2.25rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.5vw, 3.5rem);
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: 0.01em;
  line-height: 1.15;
  transition: color 0.3s ease;
}

.roles {
  margin-top: 0.5rem;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 1.125rem;
}

.roles .dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin: 0 0.45rem;
  vertical-align: middle;
  color: var(--accent-soft);
  opacity: 0.75;
}

.roles .dot svg {
  width: 100%;
  height: 100%;
}

.bio {
  margin-top: 1rem;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  max-width: 42rem;
  line-height: 1.65;
}

.bio strong,
.bio .highlight {
  color: var(--accent-text);
  font-weight: 600;
}

.hero-ctas {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  letter-spacing: -0.01em;
  color: var(--text-dim);
  font-size: 1.0625rem;
  max-width: 48rem;
}

/* Inline chips / pills */
.chip {
  display: inline-flex;
  cursor: pointer;
  align-items: center;
  gap: 0.2rem;
  border-radius: 0.25rem;
  background: var(--chip-bg);
  padding: 0.2rem 0.4rem;
  font-size: 0.8125rem;
  letter-spacing: 0;
  color: var(--text-heading);
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
  vertical-align: middle;
  margin: 0 0.2rem;
  border: 1px solid transparent;
  font-family: inherit;
  line-height: 1.4;
}

.chip:hover {
  background: var(--accent-dim);
  color: var(--accent-text);
  border-color: var(--accent-border);
  box-shadow: 0 0 10px var(--accent-dim);
}

.chip svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.chip.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  border-color: var(--accent-border);
  background: var(--accent-dim);
  color: var(--accent-text);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* Sections */
.section {
  width: 100%;
  padding: 2rem 0;
}

.section-title {
  position: relative;
  margin-top: 0.5rem;
  width: fit-content;
  max-width: 100%;
  padding: 0.3rem 0.65rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-heading);
  font-size: 1.125rem;
}

.section-title .bg {
  position: absolute;
  inset: 0;
  background: var(--section-title-bg);
  z-index: 0;
  border: 1px solid var(--accent-dim);
}

.section-title .corner {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.section-title .corner.tl {
  top: -2px;
  left: -2px;
}
.section-title .corner.tr {
  top: -2px;
  right: -2px;
}
.section-title .corner.bl {
  bottom: -2px;
  left: -2px;
}
.section-title .corner.br {
  bottom: -2px;
  right: -2px;
}

.section-title > span:last-child {
  position: relative;
  z-index: 1;
}

/* Projects */
.projects-list {
  margin-top: 1.75rem;
}

.project-card {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 1.75rem;
  border: 1px dashed var(--border);
  padding: 1.35rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
  border-radius: 2px;
}

.project-card:hover {
  border-color: var(--accent-border);
  background: var(--card-bg);
  box-shadow: 0 0 0 1px var(--accent-dim), 0 12px 40px var(--shadow-card);
}

.project-media {
  position: relative;
  aspect-ratio: 16 / 9;
  width: min(420px, 42%);
  max-width: 100%;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0.35rem;
  background: var(--media-bg);
  border: 1px solid var(--border);
}

.project-card:hover .project-media {
  border-color: var(--accent-border);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-media .placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-radius: 0.35rem;
  background: repeating-linear-gradient(
    -45deg,
    var(--placeholder-a),
    var(--placeholder-a) 10px,
    var(--placeholder-b) 10px,
    var(--placeholder-b) 20px
  );
}

.project-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  letter-spacing: 0.02em;
  flex-wrap: wrap;
}

.project-name-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.project-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-heading);
}

.project-logo {
  border: 1px solid var(--accent-border);
  padding: 2px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  color: var(--accent-text);
  background: var(--view-all-bg);
}

.project-logo img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.project-links {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.875rem;
  color: #d4d4d4;
}

.project-links .sep {
  font-weight: 700;
  color: var(--text-muted);
}

.project-desc {
  margin: 0.75rem 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 40rem;
}

.tech-label {
  margin: 0.35rem 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-dim);
}

.tech-list {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tech-list .chip {
  margin: 0;
  cursor: default;
  font-size: 0.75rem;
}

.tech-list .chip:hover {
  background: var(--accent-dim);
  color: var(--accent-text);
  border-color: var(--accent-border);
}

.section-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.view-all {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.35rem;
  border-radius: 0.25rem;
  border: 1px solid var(--border);
  background: var(--view-all-bg);
  padding: 0.35rem 0.65rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.view-all:hover {
  color: var(--accent-text);
  border-color: var(--accent-border);
  background: var(--accent-dim);
  box-shadow: 0 0 14px var(--accent-dim);
}

.view-all svg {
  width: 1em;
  height: 1em;
  transition: color 0.2s;
}

/* Blog list */
.blog-list {
  margin-top: 1.75rem;
}

.blog-item {
  display: block;
  margin-top: 1.75rem;
  padding: 0.85rem 0.5rem;
  margin-left: -0.5rem;
  margin-right: -0.5rem;
  border-radius: 0.35rem;
  transition: background 0.25s;
}

.blog-item:first-child {
  margin-top: 0;
}

.blog-item:hover {
  background: var(--accent-dim);
}

.blog-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  font-weight: 600;
  color: var(--text-heading);
}

.blog-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-heading);
  line-height: 1.35;
}

.blog-title svg {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.35rem;
  color: var(--blog-arrow);
  transition: color 0.2s;
  width: 22px;
  height: 22px;
}

.blog-item:hover .blog-title {
  color: var(--accent-text);
}

.blog-item:hover .blog-title svg {
  color: var(--accent);
}

.blog-date {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--text-dim);
  flex-shrink: 0;
  font-weight: 400;
}

.blog-date svg {
  width: 1em;
  height: 1em;
  color: var(--accent-soft);
  opacity: 0.7;
}

.blog-excerpt {
  margin-top: 0.4rem;
  max-width: 48rem;
  font-size: 0.975rem;
  line-height: 1.5;
  color: var(--text-muted);
  font-weight: 400;
}

/* CTA */
.cta {
  padding: 2.5rem 0 2.5rem;
  border-top: 1px dashed var(--border);
  margin-top: 1rem;
  position: relative;
}

.cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4rem;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.cta h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  font-weight: 400;
  color: var(--text-heading);
  margin-bottom: 0.65rem;
}

.cta p {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 36rem;
  line-height: 1.6;
}

.cta a {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-border);
  transition: color 0.2s, text-decoration-color 0.2s;
}

.cta a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* Footer */
.footer {
  border-top: 1px dashed var(--border);
  padding: 1.75rem 0 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-left p {
  margin-bottom: 0.2rem;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  text-align: right;
}

.footer [data-visitors],
.footer [data-clock] {
  color: var(--accent-text);
  opacity: 0.85;
}

/* Inner pages */
.page-header {
  padding: 2.5rem 0 1.35rem;
  border-bottom: 1px dashed var(--border);
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: var(--text-primary);
  font-weight: 400;
}

.page-header p {
  margin-top: 0.65rem;
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 40rem;
}

.page-content {
  padding: 2rem 0 3rem;
}

.prose {
  font-size: 1.0625rem;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 48rem;
}

.prose p + p {
  margin-top: 0.85rem;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-heading);
  font-weight: 400;
  margin: 2rem 0 0.65rem;
}

.placeholder-note {
  border: 1px dashed var(--accent-border);
  padding: 1.15rem 1.25rem;
  border-radius: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--accent-dim);
  margin-bottom: 1.5rem;
}

.placeholder-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  background: var(--code-bg);
  padding: 0.12rem 0.35rem;
  border-radius: 0.2rem;
  color: var(--accent-text);
  border: 1px solid var(--accent-border);
}

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

/* —— Large desktop —— */
@media (min-width: 1280px) {
  :root {
    --max-w: 80rem; /* 1280px */
    --px: 3rem;
  }

  .hero {
    padding: 3.5rem 0 2.75rem;
  }

  .project-media {
    width: min(480px, 44%);
  }

  .project-name {
    font-size: 1.65rem;
  }
}

/* —— Tablet —— */
@media (max-width: 960px) {
  :root {
    --max-w: 100%;
    --px: 1.75rem;
  }

  .project-media {
    width: min(340px, 40%);
  }

  .hero h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
  }
}

/* —— Mobile —— */
@media (max-width: 768px) {
  :root {
    --px: 1.15rem;
  }

  .shell {
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .header {
    height: 3.75rem;
  }

  .logo-mark {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .nav-link {
    padding: 0.3rem 0.55rem;
    font-size: 0.8125rem;
  }

  .hero {
    padding: 1.75rem 0 1.25rem;
  }

  .hero h1 {
    font-size: clamp(1.85rem, 8vw, 2.25rem);
  }

  .roles {
    font-size: 0.95rem;
  }

  .bio {
    font-size: 0.9rem;
    max-width: 100%;
  }

  .hero-ctas {
    gap: 0.65rem;
    font-size: 0.9375rem;
  }

  .section {
    padding: 1.35rem 0;
  }

  .section-title {
    font-size: 1rem;
  }

  .project-card {
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
  }

  .project-media {
    width: 100%;
  }

  .project-name {
    font-size: 1.25rem;
  }

  .project-desc {
    font-size: 0.85rem;
  }

  .blog-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.4rem;
  }

  .blog-title {
    font-size: 1.1rem;
    max-width: 100%;
  }

  .blog-excerpt {
    max-width: 100%;
    font-size: 0.875rem;
  }

  .cta h2 {
    font-size: 1.35rem;
  }

  .cta p {
    font-size: 0.9rem;
  }

  .footer {
    flex-direction: column;
    font-size: 0.8rem;
  }

  .footer-meta {
    align-items: flex-start;
    text-align: left;
  }

  .page-header h1 {
    font-size: 1.85rem;
  }

  .prose {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  :root {
    --px: 1rem;
  }

  .nav {
    gap: 0.35rem;
  }
}
