:root {
  --bg: #f3efe7;
  --surface: #fffaf1;
  --surface-strong: #ffffff;
  --surface-tint: rgba(255, 250, 241, 0.9);
  --ink: #151617;
  --ink-inverse: #ffffff;
  --muted: #61666a;
  --line: #d8d1c7;
  --teal: #0f6f69;
  --teal-dark: #073c39;
  --coral: #c4513f;
  --gold: #dba83d;
  --blue: #263f8f;
  --header-bg: rgba(252, 248, 240, 0.82);
  --body-grid: rgba(15, 111, 105, 0.08);
  --body-end: #ece7dd;
  --placeholder-line: rgba(21, 22, 23, 0.12);
  --placeholder-grid: rgba(21, 22, 23, 0.08);
  --shadow: 0 18px 55px rgba(21, 22, 23, 0.12);
  --radius: 8px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111412;
  --surface: #171b18;
  --surface-strong: #20251f;
  --surface-tint: rgba(23, 27, 24, 0.94);
  --ink: #f4f0e8;
  --ink-inverse: #0f1110;
  --muted: #b2b7b1;
  --line: #30372f;
  --teal: #64c4b8;
  --teal-dark: #9be4db;
  --coral: #ff8f7c;
  --gold: #f1c86a;
  --blue: #8fa6ff;
  --header-bg: rgba(17, 20, 18, 0.84);
  --body-grid: rgba(100, 196, 184, 0.08);
  --body-end: #151812;
  --placeholder-line: rgba(244, 240, 232, 0.14);
  --placeholder-grid: rgba(244, 240, 232, 0.08);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(90deg, var(--body-grid) 1px, transparent 1px),
    linear-gradient(180deg, var(--surface) 0%, var(--bg) 52%, var(--body-end) 100%);
  background-size: 44px 44px, auto;
  color: var(--ink);
  line-height: 1.6;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px max(18px, calc((100vw - 1180px) / 2));
  backdrop-filter: blur(18px);
  background: var(--header-bg);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

.brand {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--ink-inverse);
  font-weight: 900;
  overflow: hidden;
}

.brand img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: var(--surface-strong);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav {
  display: flex;
  gap: 24px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 750;
}

.theme-toggle {
  position: relative;
  min-width: 78px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(21, 22, 23, 0.07);
}

.theme-toggle::before {
  content: "";
  position: absolute;
  left: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 18%, transparent);
}

:root[data-theme="dark"] .theme-toggle {
  justify-content: flex-start;
  padding: 0 34px 0 12px;
}

:root[data-theme="dark"] .theme-toggle::before {
  left: auto;
  right: 8px;
  background: var(--teal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 18%, transparent);
}

.nav a:hover,
.hero-panel-bottom a:hover,
.card-link:hover {
  color: var(--teal-dark);
}

.section {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 86px 0;
}

.hero {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) 420px;
  gap: 44px;
  align-items: center;
  padding-top: 44px;
}

.hero-copy-block {
  max-width: 760px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--coral);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.78rem;
}

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

h1 {
  margin-bottom: 16px;
  font-size: 8.1rem;
  line-height: 0.86;
  font-weight: 900;
}

h2 {
  max-width: 820px;
  font-size: 4rem;
  line-height: 0.98;
  font-weight: 900;
  margin-bottom: 18px;
}

h3 {
  font-size: 1.18rem;
  line-height: 1.2;
  font-weight: 850;
  margin-bottom: 9px;
}

.hero-title {
  color: var(--teal-dark);
  font-size: 1.65rem;
  font-weight: 850;
  margin-bottom: 18px;
}

.hero-copy {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.17rem;
  margin-bottom: 30px;
}

.hero-actions,
.form-actions,
.tool-actions,
.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 800;
  background: var(--surface-strong);
  box-shadow: 0 8px 22px rgba(21, 22, 23, 0.07);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.button.primary {
  background: var(--teal-dark);
  color: var(--ink-inverse);
  border-color: var(--teal-dark);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(21, 22, 23, 0.12);
}

.hero-panel,
.card,
.skill-card,
.timeline-item,
.contact-card,
.admin-panel,
.admin-stats,
.image-preview {
  background: var(--surface-tint);
  border: 1px solid color-mix(in srgb, var(--line) 95%, transparent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 18px;
  overflow: hidden;
}

.hero-panel-top,
.hero-panel-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-panel-top {
  align-items: flex-start;
  padding: 4px 2px 16px;
  border-bottom: 1px solid var(--line);
}

.hero-panel-top span {
  display: block;
  margin-bottom: 2px;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-panel-top strong {
  display: block;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.05;
  font-weight: 900;
}

.hero-panel-top small {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--teal-dark);
  background: color-mix(in srgb, var(--teal) 10%, transparent);
  font-size: 0.72rem;
  font-weight: 900;
}

.hero-panel-bottom a {
  color: var(--ink);
}

.showcase-stack {
  display: grid;
  gap: 10px;
  padding: 16px 0;
}

.showcase-mini {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 92px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-strong) 76%, transparent);
}

.showcase-thumb {
  position: relative;
  width: 74px;
  height: 68px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--teal) 28%, transparent), color-mix(in srgb, var(--coral) 18%, transparent)),
    repeating-linear-gradient(0deg, var(--placeholder-grid) 0 1px, transparent 1px 14px);
}

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

.showcase-initials {
  position: absolute;
  inset: 9px;
  display: grid;
  place-items: center;
  border: 1px solid var(--placeholder-line);
  color: var(--teal-dark);
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
}

.showcase-content {
  min-width: 0;
}

.showcase-mini h3 {
  margin-bottom: 5px;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.showcase-mini p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.hero-panel-bottom {
  align-items: center;
  padding: 15px 2px 2px;
  border-top: 1px solid var(--line);
  font-weight: 800;
}

.hero-panel-bottom span {
  max-width: 260px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 72px;
  align-items: start;
  border-top: 1px solid var(--line);
}

.split p:last-child,
.section-heading > p:last-child,
.contact-card p:not(.section-kicker),
.admin-hero p,
.admin-tools p {
  color: var(--muted);
  font-size: 1.05rem;
}

.section-heading {
  margin-bottom: 28px;
}

.project-grid,
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card,
.skill-card,
.timeline-item {
  padding: 18px;
}

.card {
  min-height: 410px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card p,
.skill-card p,
.timeline-item p {
  color: var(--muted);
}

.project-image {
  position: relative;
  min-height: 176px;
  margin: -18px -18px 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(15, 111, 105, 0.18), rgba(196, 81, 63, 0.14)),
    repeating-linear-gradient(0deg, var(--placeholder-grid) 0 1px, transparent 1px 18px);
}

.project-image img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  object-fit: cover;
}

.project-placeholder {
  position: absolute;
  inset: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--placeholder-line);
  color: var(--teal-dark);
  font-weight: 900;
  text-align: center;
}

.project-status {
  width: max-content;
  margin-bottom: 12px;
  padding: 5px 9px;
  border-radius: var(--radius);
  background: rgba(219, 168, 61, 0.2);
  color: color-mix(in srgb, var(--gold) 58%, var(--ink));
  font-size: 0.76rem;
  font-weight: 900;
}

.card-meta,
.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-meta {
  margin: 17px 0 22px;
}

.pill {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  background: color-mix(in srgb, var(--surface-strong) 68%, transparent);
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
}

.card-link {
  color: var(--teal-dark);
  font-weight: 900;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 22px;
}

.timeline-date {
  color: var(--coral);
  font-weight: 900;
}

.skill-list {
  margin-top: 18px;
}

.contact-card {
  padding: 48px;
  margin-bottom: 72px;
}

.footer {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 42px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 0.92rem;
}

.admin-body {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--blue) 8%, transparent) 1px, transparent 1px),
    linear-gradient(180deg, var(--surface) 0%, var(--body-end) 100%);
  background-size: 40px 40px, auto;
}

.admin-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 54px 0 86px;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.admin-hero h1 {
  max-width: 780px;
  font-size: 5rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  padding: 0;
  background: var(--line);
}

.admin-stats div {
  padding: 20px;
  background: var(--surface);
}

.admin-stats span {
  display: block;
  font-size: 2.2rem;
  line-height: 1;
  font-weight: 900;
}

.admin-stats p {
  margin: 7px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.62fr) minmax(360px, 0.9fr) minmax(0, 1.18fr);
  gap: 18px;
  align-items: start;
}

.admin-panel {
  padding: 22px;
}

.panel-heading h2,
.admin-tools h2 {
  font-size: 2rem;
  margin-bottom: 14px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 13px;
  background: var(--surface-strong);
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 111, 105, 0.16);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.upload-zone {
  padding: 15px;
  border: 1px dashed var(--teal);
  border-radius: var(--radius);
  background: rgba(15, 111, 105, 0.08);
}

.upload-zone span {
  color: var(--muted);
}

.upload-zone strong {
  color: var(--teal-dark);
}

.upload-zone input,
.identity-panel input[type="file"],
.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.identity-preview {
  width: 128px;
  height: 128px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--ink-inverse);
  font-size: 2rem;
  font-weight: 900;
}

.identity-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: var(--surface-strong);
}

.image-preview {
  min-height: 160px;
  margin-bottom: 15px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(38, 63, 143, 0.1), rgba(15, 111, 105, 0.1)),
    repeating-linear-gradient(90deg, var(--placeholder-grid) 0 1px, transparent 1px 18px);
}

.image-preview img {
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.admin-project-list {
  display: grid;
  gap: 12px;
}

.admin-project-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
}

.admin-project-item .project-image {
  min-height: 86px;
  margin: 0;
  border-radius: var(--radius);
}

.admin-project-item h3 {
  margin-bottom: 5px;
}

.admin-project-item p {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.9rem;
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 800;
}

.small-button.danger {
  border-color: rgba(196, 81, 63, 0.35);
  color: var(--coral);
}

.admin-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 22px;
  margin-top: 18px;
  align-items: start;
}

.admin-tools textarea {
  grid-column: 1 / -1;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
}

.file-button {
  margin: 0;
}

@media (max-width: 980px) {
  h1,
  .admin-hero h1 {
    font-size: 4.4rem;
  }

  h2 {
    font-size: 3rem;
  }

  .hero,
  .admin-hero,
  .admin-layout,
  .admin-tools {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-panel {
    max-width: 620px;
  }

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

@media (max-width: 720px) {
  .nav {
    display: none;
  }

  .section,
  .admin-shell {
    width: min(100% - 28px, 1180px);
  }

  .section {
    padding: 62px 0;
  }

  .hero {
    padding-top: 60px;
  }

  h1,
  .admin-hero h1 {
    font-size: 3.35rem;
    line-height: 0.95;
  }

  h2 {
    font-size: 2.28rem;
  }

  .split,
  .timeline-item,
  .field-grid,
  .project-grid,
  .skills-grid,
  .admin-project-item {
    grid-template-columns: 1fr;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .contact-card {
    padding: 28px;
  }

  .footer {
    flex-direction: column;
  }
}
