:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --surface: #fffdf8;
  --text: #1b1b19;
  --muted: #66645d;
  --line: #ded8c8;
  --accent: #184d47;
  --accent-2: #9b3d2f;
  --shadow: 0 24px 70px rgba(38, 35, 26, 0.12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111312;
  --surface: #181b19;
  --text: #f3efe5;
  --muted: #b8b1a3;
  --line: #34352f;
  --accent: #8bc7bd;
  --accent-2: #e1917e;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero { animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.intro { animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards; opacity: 0; }
.section { animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards; opacity: 0; }
.contact { animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards; opacity: 0; }

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

.page {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-height: 84px;
}

.nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav a {
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.94rem;
  transition: all 0.2s ease;
}

.nav a:hover,
.nav a:focus-visible {
  background: rgba(24, 77, 71, 0.09);
  color: var(--text);
  outline: none;
}

.theme-toggle,
.lang-toggle {
  position: relative;
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.lang-toggle:hover,
.lang-toggle:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
  outline: none;
}

.theme-toggle-icon {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

:root[data-theme="dark"] .theme-toggle-icon {
  border-color: transparent;
  background: currentColor;
  box-shadow: -6px -3px 0 0 var(--surface);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(28px, 7vw, 96px);
  align-items: center;
  min-height: calc(100vh - 132px);
  padding: 48px 0 72px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4.4rem, 9vw, 8.8rem);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: 0;
}

.lead {
  max-width: 650px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.36rem);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--text);
  font-weight: 750;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--bg);
}

.button.ghost {
  color: var(--muted);
}

.button.primary:hover {
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent);
  transform: translateY(-2px);
}

.button:hover,
.button:focus-visible,
.contact-links a:hover,
.contact-links a:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.portrait {
  width: min(100%, 360px);
  margin: 0;
  justify-self: end;
}

.portrait img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s ease;
}

.portrait img:hover {
  transform: scale(1.03) rotate(-1deg);
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.15);
}

:root[data-theme="dark"] .portrait img:hover {
  box-shadow: 0 32px 64px rgba(255, 255, 255, 0.05);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.75fr);
  gap: 48px;
  align-items: end;
  padding: 48px 0 78px;
  border-top: 1px solid var(--line);
}

.intro > p {
  max-width: 760px;
  margin: 0;
  font-size: clamp(1.5rem, 3.4vw, 2.55rem);
  line-height: 1.16;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0;
}

.facts div {
  padding: 16px;
  border-top: 2px solid var(--accent);
  background: color-mix(in srgb, var(--surface) 48%, transparent);
}

.facts dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.facts dd {
  margin: 8px 0 0;
  font-size: 1.28rem;
  font-weight: 850;
}

.section {
  padding: 76px 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: 0.72fr 1fr;
  gap: 36px;
  align-items: start;
  margin-bottom: 34px;
}

.section-heading h2,
.contact h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

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

.project {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 24px;
  margin: 0 -24px;
  border-radius: 16px;
  border: 1px solid transparent;
  border-top: 1px solid var(--line);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.project:hover {
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  border-color: var(--line);
  border-top-color: var(--line);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.project:last-child {
  border-bottom: 1px solid var(--line);
}

.meta {
  margin: 0 0 6px;
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.project h3 {
  margin: 0;
  font-size: clamp(1.28rem, 2.2vw, 1.85rem);
  line-height: 1.2;
}

.project p:not(.meta) {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
}

.project a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 850;
  transition: all 0.2s ease;
}

.project a:hover,
.project a:focus-visible {
  background: var(--accent);
  color: var(--bg);
  padding: 0 20px;
  border-radius: 999px;
  border-bottom: 2px solid transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px color-mix(in srgb, var(--accent) 25%, transparent);
  outline: none;
}

.contact {
  padding: 76px 0 96px;
  border-top: 1px solid var(--line);
}

.contact h2 {
  max-width: 850px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  margin-top: 30px;
}

.contact-links a {
  color: var(--accent);
  font-weight: 850;
  border-bottom: 2px solid currentColor;
}

@media (max-width: 820px) {
  .page {
    width: min(100% - 28px, 680px);
  }

  .site-header {
    min-height: 72px;
  }

  .nav {
    gap: 0;
  }

  .nav a {
    padding-inline: 10px;
    font-size: 0.88rem;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 34px 0 58px;
  }

  h1 {
    font-size: clamp(3.6rem, 18vw, 6rem);
  }

  .portrait {
    width: min(100%, 300px);
    justify-self: start;
  }

  .intro,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .intro {
    gap: 28px;
  }

  .facts {
    grid-template-columns: 1fr;
  }

  .section,
  .contact {
    padding-block: 58px;
  }

  .project {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 20px;
    margin: 0 -20px;
  }

  .project a {
    justify-self: start;
  }
}

@media (max-width: 460px) {
  .site-header {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    padding-top: 16px;
  }

  .nav {
    width: auto;
    justify-content: flex-start;
  }

  .contact-links {
    align-items: stretch;
    flex-direction: column;
  }

}
