:root {
  --bg: #f4efe8;
  --bg-accent: #efe3d3;
  --surface: rgba(255, 252, 247, 0.92);
  --surface-strong: #fffdf9;
  --surface-muted: #f2e8da;
  --text: #1f1b16;
  --text-muted: #655d54;
  --accent: #a44932;
  --accent-strong: #863723;
  --accent-soft: #dcc2a9;
  --secondary: #244c52;
  --secondary-soft: #d8e6e6;
  --success: #1d6a45;
  --error: #ab2e2e;
  --border: rgba(95, 72, 53, 0.14);
  --shadow: 0 24px 60px rgba(61, 43, 25, 0.14);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: 1160px;
}

body[data-theme="dark"] {
  --bg: #161311;
  --bg-accent: #231b17;
  --surface: rgba(31, 25, 22, 0.92);
  --surface-strong: #231d19;
  --surface-muted: #2e2621;
  --text: #f6efe6;
  --text-muted: #c5b9ad;
  --accent: #e28963;
  --accent-strong: #f2a07c;
  --accent-soft: rgba(226, 137, 99, 0.18);
  --secondary: #7bc2cb;
  --secondary-soft: rgba(123, 194, 203, 0.12);
  --success: #68d19d;
  --error: #ff8d8d;
  --border: rgba(255, 236, 219, 0.1);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(228, 176, 135, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(36, 76, 82, 0.14), transparent 22%),
    linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 38%, var(--bg) 100%);
  color: var(--text);
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  line-height: 1.65;
}

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

a:hover,
a:focus-visible {
  color: var(--accent);
}

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

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

button {
  color: inherit;
}

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
}

.section {
  padding: 5.25rem 0;
  scroll-margin-top: 92px;
}

.eyebrow,
.summary-label,
.panel-label,
.card-kicker {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 0.9rem;
}

.section-title {
  max-width: 720px;
  margin-bottom: 1.8rem;
}

.section-title h2,
.section-copy h2,
.panel-card h2,
.contact-copy h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.06;
  margin-bottom: 0.85rem;
}

.section-title p,
.section-copy p,
.tagline,
.intro,
.contact-copy p,
.detail-card p,
.info-card p,
.project-summary,
.footer-note {
  color: var(--text-muted);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(244, 239, 232, 0.72);
  backdrop-filter: blur(18px);
}

body[data-theme="dark"] .site-header {
  background: rgba(22, 19, 17, 0.72);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.2rem;
  font-size: 0.96rem;
  font-weight: 700;
}

.theme-toggle,
.btn,
.filter-btn,
.text-button {
  border-radius: 999px;
}

.theme-toggle,
.text-button,
.filter-btn {
  border: 1px solid var(--border);
  background: var(--surface);
}

.theme-toggle {
  cursor: pointer;
  font-weight: 800;
  padding: 0.65rem 0.95rem;
}

.hero {
  padding-top: 2rem;
}

.hero-grid {
  display: grid;
  align-items: center;
  gap: 2rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.9fr);
  padding: clamp(2rem, 4vw, 3rem);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-lg) + 8px);
  background:
    linear-gradient(145deg, rgba(255, 250, 243, 0.92), rgba(242, 232, 218, 0.8)),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

body[data-theme="dark"] .hero-grid {
  background:
    linear-gradient(145deg, rgba(40, 31, 26, 0.96), rgba(28, 22, 19, 0.94)),
    var(--surface);
}

.hero-grid::after {
  content: "";
  position: absolute;
  inset: auto -3.5rem -3.5rem auto;
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  background: rgba(36, 76, 82, 0.1);
  filter: blur(8px);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  line-height: 0.98;
  max-width: 11ch;
  margin-bottom: 1rem;
}

.tagline {
  max-width: 60ch;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.intro {
  max-width: 54ch;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  margin-bottom: 1.4rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 1.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  padding: 0.7rem 1.15rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.btn.secondary {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

.btn.compact {
  min-height: 42px;
  padding: 0.55rem 0.85rem;
}

.btn:hover,
.btn:focus-visible {
  background: var(--accent-strong);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(164, 73, 50, 0.2);
}

.btn.secondary:hover,
.btn.secondary:focus-visible {
  background: var(--accent);
}

.hero-metrics {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
}

.hero-metrics li,
.panel-card,
.info-card,
.detail-card,
.skills-panel,
.project-overview,
.contact-form {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-metrics li {
  min-height: 116px;
  padding: 1rem;
}

.hero-metrics strong {
  display: block;
  color: var(--secondary);
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  line-height: 1;
  margin-bottom: 0.55rem;
}

.hero-metrics span {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.hero-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
}

.hero-portrait {
  width: min(100%, 360px);
  margin-inline: auto;
  filter: drop-shadow(0 26px 40px rgba(91, 53, 38, 0.18));
}

.panel-card,
.info-card,
.detail-card {
  padding: 1.25rem;
}

.panel-label,
.summary-label,
.card-kicker {
  color: var(--secondary);
  font-size: 0.74rem;
  font-weight: 800;
  margin-bottom: 0.7rem;
}

.panel-card h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.split-layout {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.95fr);
  align-items: start;
}

.feature-stack,
.feature-grid,
.highlights-grid,
.workflow-grid,
.projects-grid {
  display: grid;
  gap: 1.25rem;
}

.feature-stack {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.highlights-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 100%;
}

.info-card h3,
.detail-card h3,
.card-body h3 {
  font-size: 1.25rem;
  margin-bottom: 0.45rem;
}

.small-note,
.api-status,
.project-status,
.project-meta,
.contact-list,
.form-status,
.quality-list,
.footer-inner {
  color: var(--text-muted);
}

.inline-form {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(130px, 1fr) auto auto;
  margin-top: auto;
}

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

.text-button {
  cursor: pointer;
  font-weight: 800;
  padding: 0.55rem 0.8rem;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease;
}

.text-button:hover,
.text-button:focus-visible,
.filter-btn:hover,
.filter-btn:focus-visible,
.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.weather-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: auto;
}

.weather-grid div {
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.weather-grid dt {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.weather-grid dd {
  font-size: 1.2rem;
  font-weight: 800;
}

.availability-pill {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 40px;
  border-radius: 999px;
  background: var(--secondary-soft);
  color: var(--secondary);
  font-weight: 800;
  padding: 0.45rem 0.85rem;
}

.project-overview {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.project-summary {
  max-width: 56ch;
}

.summary-chip-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.summary-chip-row span,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-strong);
  padding: 0.45rem 0.75rem;
  font-weight: 700;
}

.project-controls {
  display: grid;
  gap: 1rem;
  align-items: end;
  grid-template-columns: 1.3fr 0.75fr 0.75fr 1fr;
  margin-bottom: 1rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.filter-btn {
  cursor: pointer;
  font-weight: 800;
  min-height: 40px;
  padding: 0.45rem 0.8rem;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 12px 24px rgba(164, 73, 50, 0.12);
}

.control-field,
.search-group {
  display: grid;
  gap: 0.4rem;
}

.control-field label {
  font-size: 0.9rem;
  font-weight: 800;
}

.project-status,
.form-status {
  min-height: 1.4rem;
}

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

.card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 52px rgba(61, 43, 25, 0.18);
}

.project-card.is-hidden {
  display: none;
}

.card img {
  width: 100%;
  aspect-ratio: 31 / 18;
  object-fit: cover;
  background: var(--surface-muted);
}

.card-body {
  padding: 1.2rem;
}

.project-meta {
  font-size: 0.88rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.workflow-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1.25rem;
}

.skills-panel {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  padding: 1.25rem;
}

.quality-list {
  padding-left: 1.2rem;
}

.contact-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: start;
}

.contact-list {
  list-style: none;
  margin: 1rem 0 1rem;
}

.contact-list li + li {
  margin-top: 0.45rem;
}

.contact-form {
  display: grid;
  gap: 0.75rem;
  padding: 1.5rem;
}

input,
select,
textarea {
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  color: var(--text);
  padding: 0.78rem 0.9rem;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(164, 73, 50, 0.18);
  border-color: var(--accent);
}

.form-status.success {
  color: var(--success);
}

.form-status.error,
.field-error {
  color: var(--error);
}

.field-error {
  font-size: 0.92rem;
  min-height: 1rem;
}

.site-footer {
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.1rem;
  font-weight: 700;
}

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

@media (max-width: 1040px) {
  .hero-grid,
  .split-layout,
  .contact-grid,
  .skills-panel,
  .project-overview {
    grid-template-columns: 1fr;
  }

  .highlights-grid,
  .feature-grid,
  .workflow-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .project-controls {
    grid-template-columns: 1fr 1fr;
  }

  .filter-group,
  .search-group {
    grid-column: 1 / -1;
  }

  .projects-grid,
  .hero-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .section {
    padding: 4rem 0;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-grid {
    padding: 1.4rem;
  }

  .hero-copy h1 {
    max-width: 12ch;
  }

  .highlights-grid,
  .feature-grid,
  .workflow-grid,
  .weather-grid,
  .project-controls {
    grid-template-columns: 1fr;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .main-nav,
  .footer-links,
  .hero-actions {
    width: 100%;
  }
}
