/* Variables */
:root {
  --color-background: #ffffff;
  --color-background-muted: #f5f7f8;
  --color-text: #17202a;
  --color-text-muted: #52606d;
  --color-accent: #176b62;
  --color-accent-dark: #10564f;
  --color-border: #dce2e6;
  --color-dark: #142d2a;
  --shadow-card: 0 12px 30px rgb(23 32 42 / 8%);
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;
  --radius: 0.375rem;
  --page-width: 68.75rem;
}

/* Reset and base styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  overflow-wrap: break-word;
}

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

ul {
  margin: 0;
  padding: 0;
}

a {
  color: var(--color-accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

/* Typography */
h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--color-text);
  line-height: 1.2;
}

h1 {
  max-width: 18ch;
  margin-bottom: var(--space-lg);
  font-size: clamp(2.35rem, 8vw, 4.75rem);
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: var(--space-md);
  font-size: clamp(1.9rem, 5vw, 2.8rem);
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: var(--space-sm);
  font-size: 1.25rem;
}

h4 {
  margin: var(--space-lg) 0 var(--space-sm);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-muted);
}

.eyebrow {
  margin-bottom: var(--space-sm);
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Layout */
.container {
  width: min(100% - 2rem, var(--page-width));
  margin-inline: auto;
}

.section {
  padding-block: var(--space-3xl);
}

.section--muted {
  background: var(--color-background-muted);
}

.section-heading {
  max-width: 43rem;
  margin-bottom: var(--space-2xl);
}

.section-heading > :last-child,
.project-card__content > :last-child,
.about-copy > :last-child {
  margin-bottom: 0;
}

/* Header */
.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--color-border);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(0.5rem);
}

.header-inner {
  position: relative;
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
}

.site-name {
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 750;
  text-decoration: none;
}

.menu-button {
  display: none;
  min-height: 2.75rem;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-background);
  color: var(--color-text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.menu-button__icon,
.menu-button__icon::before,
.menu-button__icon::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
}

.menu-button__icon {
  position: relative;
}

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

.menu-button__icon::before {
  top: -0.34rem;
}

.menu-button__icon::after {
  top: 0.34rem;
}

.primary-navigation {
  position: absolute;
  top: calc(100% + 1px);
  right: 0;
  left: 0;
  display: block;
  padding: var(--space-sm) var(--space-md) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-background);
  box-shadow: var(--shadow-card);
}

.js .menu-button {
  display: inline-flex;
}

.js .primary-navigation {
  display: none;
}

.js .primary-navigation.is-open {
  display: block;
}

.primary-navigation ul {
  list-style: none;
}

.primary-navigation a {
  display: block;
  padding: 0.7rem 0.25rem;
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}

.primary-navigation a:hover {
  color: var(--color-accent);
}

/* Hero */
.hero {
  display: grid;
  min-height: min(48rem, calc(100svh - 4.5rem));
  align-items: center;
  padding-block: var(--space-3xl);
  background: linear-gradient(135deg, #fff 55%, #eef5f3);
}

.hero-grid {
  display: grid;
  gap: var(--space-2xl);
  align-items: center;
}

.hero-content {
  min-width: 0;
  padding-block: var(--space-xl);
}

.hero-summary {
  max-width: 46rem;
  margin-bottom: var(--space-xl);
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
}

.hero-subheading {
  margin-bottom: var(--space-md);
  color: var(--color-text);
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 700;
}

.hero-tags {
  margin-bottom: var(--space-xl);
}

.hero-portrait {
  width: 100%;
  max-width: 22rem;
  margin: 0;
  justify-self: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-background-muted);
  box-shadow: var(--shadow-card);
}

.hero-portrait img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Buttons */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.button {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button--primary {
  background: var(--color-accent);
  color: #fff;
}

.button--primary:hover {
  background: var(--color-accent-dark);
}

.button--secondary {
  border-color: var(--color-border);
  background: var(--color-background);
  color: var(--color-text);
}

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

.button--light {
  background: #fff;
  color: var(--color-dark);
}

.button--light:hover {
  background: #eaf2f0;
}

.button--secondary-light {
  border-color: rgb(255 255 255 / 55%);
  color: #fff;
}

.button--secondary-light:hover {
  border-color: #fff;
  background: rgb(255 255 255 / 10%);
}

.button--disabled {
  border-color: var(--color-border);
  background: var(--color-background-muted);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.button-group--small {
  margin-top: var(--space-xl);
}

/* Projects */
.project-list {
  display: grid;
  gap: var(--space-xl);
}

.project-card {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-background);
  box-shadow: var(--shadow-card);
}

.project-card__image {
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
  background: #e7eeed;
}

.project-card__image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.project-card__image--logo,
.project-card__image--development {
  display: grid;
  min-height: 16rem;
  place-items: center;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.project-card__image--logo {
  background: linear-gradient(145deg, #e8f2ef, #f8faf9);
}

.project-card__image--development {
  background: #f7f8fb;
}

.project-card__image--logo img,
.project-card__image--development img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
}

.project-card__image--logo img {
  max-width: 13rem;
  max-height: 13rem;
}

.project-card__image--development img {
  max-width: 31rem;
  max-height: 18rem;
}

.project-card__content {
  padding: var(--space-lg);
}

.project-card__number {
  margin-bottom: var(--space-xs);
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: var(--space-md);
  padding: 0.25rem 0.55rem;
  border: 1px solid #b8d8d3;
  border-radius: 0.25rem;
  background: #edf7f5;
  color: var(--color-accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.status-label span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--color-accent);
}

.status-label--pending {
  border-color: #ded2b9;
  background: #faf7ef;
  color: #68572d;
}

.status-label--pending span {
  background: #8b743b;
}

.project-card--future {
  box-shadow: none;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  list-style: none;
}

.tag-list li {
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--color-border);
  border-radius: 0.25rem;
  background: var(--color-background-muted);
  color: var(--color-text);
  font-size: 0.8rem;
  font-weight: 650;
}

.feature-list {
  display: grid;
  gap: 0.45rem;
  padding-left: 1.15rem;
  color: var(--color-text-muted);
}

.feature-list li::marker {
  color: var(--color-accent);
}

/* Skills */
.skills-section {
  background: linear-gradient(145deg, var(--color-dark), #183f3b);
}

.skills-section .section-heading h2,
.skills-section .section-heading p {
  color: #fff;
}

.skills-section .section-heading .eyebrow {
  color: #a9d8d2;
}

.skills-grid {
  display: grid;
  gap: var(--space-md);
}

.skill-group {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: var(--space-lg);
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 0.6rem;
  background: linear-gradient(145deg, rgb(255 255 255 / 12%), rgb(255 255 255 / 6%));
  box-shadow: 0 10px 25px rgb(0 0 0 / 14%);
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.skill-group::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 0.22rem;
  background: var(--skill-accent, #77c9bf);
  content: "";
}

.skill-group:hover {
  border-color: rgb(169 216 210 / 55%);
  background: linear-gradient(145deg, rgb(255 255 255 / 16%), rgb(255 255 255 / 8%));
  transform: translateY(-0.2rem);
}

.skill-group h3 {
  color: #fff;
}

.skill-group p {
  margin-bottom: 0;
  color: #d8e5e3;
  font-size: 0.92rem;
}

.skill-group--php,
.skill-group--backend {
  --skill-accent: #86b7ff;
}

.skill-group--mysql,
.skill-group--security {
  --skill-accent: #e4b866;
}

.skill-group--javascript,
.skill-group--responsive {
  --skill-accent: #77c9bf;
}

.skill-group--html,
.skill-group--css {
  --skill-accent: #d89bc2;
}

.skill-group--ai {
  --skill-accent: linear-gradient(90deg, #77c9bf, #86b7ff, #d89bc2);
  grid-column: 1 / -1;
}

.skill-group__heading,
.ai-highlight-card__heading {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
}

.skill-group__heading > div,
.ai-highlight-card__heading > div {
  min-width: 0;
}

.ai-monogram {
  display: inline-grid;
  width: 2.7rem;
  height: 2.7rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 0.45rem;
  background: linear-gradient(145deg, #176b62, #315f91);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ai-skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-lg);
  list-style: none;
}

.ai-skill-list li {
  padding: 0.35rem 0.65rem;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 0.3rem;
  background: rgb(255 255 255 / 8%);
  color: #eef7f5;
  font-size: 0.82rem;
  font-weight: 650;
}

/* Experience */
.experience-card {
  display: grid;
  gap: var(--space-xl);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border-left: 0.25rem solid var(--color-accent);
  background: var(--color-background);
  box-shadow: var(--shadow-card);
}

.experience-card p {
  margin-bottom: 0;
}

.ai-highlight-card {
  display: grid;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
  padding: clamp(1.5rem, 5vw, 2.25rem);
  border: 1px solid #bddbd7;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #f2f8f7, #eef3f9);
  box-shadow: var(--shadow-card);
}

.ai-highlight-card .ai-monogram {
  border-color: transparent;
}

.ai-highlight-card .eyebrow {
  margin-bottom: 0.25rem;
}

.ai-highlight-card h3 {
  margin-bottom: 0;
}

.ai-highlight-card ul {
  display: grid;
  gap: 0.55rem;
  list-style: none;
}

.ai-highlight-card li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
  color: var(--color-text-muted);
}

.ai-highlight-card li span {
  color: var(--color-accent);
  font-weight: 800;
}

/* About */
.about-layout {
  display: grid;
  gap: var(--space-lg);
}

.about-layout .section-heading {
  margin-bottom: 0;
}

.about-copy {
  max-width: 43rem;
  font-size: 1.05rem;
}

/* CV */
.cv-section {
  padding-block: 0;
}

.callout {
  display: grid;
  gap: var(--space-xl);
  padding: clamp(1.75rem, 6vw, 3.5rem);
  border-radius: var(--radius);
  background: var(--color-dark);
}

.callout h2,
.callout p {
  color: #fff;
}

.callout .eyebrow {
  color: #a9d8d2;
}

.callout > div:first-child > :last-child {
  margin-bottom: 0;
}

/* Contact */
.contact-layout {
  display: grid;
  gap: var(--space-xl);
}

.contact-layout .section-heading {
  margin-bottom: 0;
}

.contact-details dl {
  margin: 0 0 var(--space-xl);
}

.contact-details dl div {
  display: grid;
  gap: 0.15rem;
  padding-block: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.contact-details dt {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--color-text);
  font-weight: 600;
}

/* Availability */
.availability-card {
  display: grid;
  gap: var(--space-xl);
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-background);
  box-shadow: var(--shadow-card);
}

.availability-card h2 {
  max-width: 18ch;
}

.availability-card > div > :last-child {
  margin-bottom: 0;
}

.availability-list {
  margin: 0;
}

.availability-list div {
  padding-block: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.availability-list div:first-child {
  padding-top: 0;
}

.availability-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.availability-list dt {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.availability-list dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
  color: var(--color-text);
  font-weight: 600;
}

/* Case studies */
.case-study-hero {
  padding-block: var(--space-3xl);
  background: linear-gradient(135deg, #fff 55%, #eef5f3);
}

.case-study-hero h1 {
  max-width: 20ch;
}

.case-study-hero__summary {
  max-width: 46rem;
  font-size: 1.15rem;
}

.back-link {
  display: inline-block;
  margin-bottom: var(--space-xl);
  font-weight: 700;
}

.case-study-layout {
  display: grid;
  gap: var(--space-2xl);
}

.case-study-content {
  min-width: 0;
}

.case-study-section {
  padding-block: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.case-study-section:first-child {
  padding-top: 0;
}

.case-study-section:last-child {
  border-bottom: 0;
}

.case-study-section h2 {
  font-size: clamp(1.6rem, 4vw, 2rem);
}

.case-study-section h3 {
  margin-top: var(--space-lg);
}

.case-study-sidebar {
  align-self: start;
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-background-muted);
}

.case-study-sidebar dl {
  margin: 0;
}

.case-study-sidebar div {
  padding-block: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.case-study-sidebar div:last-child {
  border-bottom: 0;
}

.case-study-sidebar dt {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.case-study-sidebar dd {
  margin: 0.2rem 0 0;
  color: var(--color-text);
  font-weight: 600;
}

.screenshot-gallery {
  display: grid;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

.screenshot-gallery figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-background);
}

.screenshot-gallery a {
  display: block;
  background: #e7eeed;
}

.screenshot-gallery img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.screenshot-gallery figcaption {
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  padding-block: var(--space-xl);
  border-top: 1px solid var(--color-border);
  background: var(--color-background-muted);
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
}

/* Responsive breakpoints */
@media (min-width: 40rem) {
  .container {
    width: min(100% - 3rem, var(--page-width));
  }

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

  .experience-card,
  .about-layout,
  .contact-layout,
  .availability-card {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }

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

  .callout {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .project-card__content {
    padding: var(--space-xl);
  }

  .ai-highlight-card {
    grid-template-columns: minmax(15rem, 0.75fr) minmax(0, 1.25fr);
    align-items: center;
  }
}

@media (min-width: 52rem) {
  .js .menu-button {
    display: none;
  }

  .primary-navigation,
  .js .primary-navigation {
    position: static;
    display: block;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .primary-navigation ul {
    display: flex;
    align-items: center;
    gap: 0.15rem;
  }

  .primary-navigation a {
    padding: 0.55rem 0.65rem;
    font-size: 0.86rem;
  }

  .project-card {
    display: grid;
    grid-template-columns: minmax(17rem, 0.85fr) minmax(0, 1.15fr);
  }

  .project-card__image {
    border-right: 1px solid var(--color-border);
    border-bottom: 0;
  }

  .project-card__image img {
    height: 100%;
  }

  .project-card__image--logo img,
  .project-card__image--development img {
    height: 100%;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(15rem, 0.65fr);
  }

  .hero-portrait {
    justify-self: end;
  }

  .case-study-layout {
    grid-template-columns: minmax(0, 1fr) 17rem;
  }

  .case-study-sidebar {
    position: sticky;
    top: 6rem;
  }
}

@media (min-width: 68rem) {
  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Accessibility and reduced motion */
.skip-link {
  position: fixed;
  z-index: 100;
  top: var(--space-sm);
  left: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-text);
  color: #fff;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid #e19f35;
  outline-offset: 3px;
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
