:root {
  --ink: #17211d;
  --muted: #66716b;
  --line: #d8ddd6;
  --paper: #f7f5ef;
  --panel: #ffffff;
  --accent: #1f6f68;
  --accent-2: #b35f3b;
  --charcoal: #26312c;
  --shadow: 0 18px 55px rgba(26, 35, 31, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

img,
video,
iframe {
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(216, 221, 214, 0.82);
  background: rgba(247, 245, 239, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  font-weight: 760;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--charcoal);
  color: white;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.main-nav a,
.admin-link,
.primary-button,
.secondary-button,
.back-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border-radius: 7px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 680;
}

.main-nav a.active,
.main-nav a:hover {
  background: var(--ink);
  color: white;
}

.header-actions {
  display: inline-flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

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

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
}

select,
input {
  min-height: 40px;
  padding: 8px 10px;
}

textarea {
  min-height: 108px;
  padding: 10px;
  resize: vertical;
}

.header-actions select {
  width: auto;
  min-width: 126px;
}

.admin-link,
.secondary-button,
.back-link {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.64);
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
}

.hero {
  position: relative;
  min-height: min(720px, 84vh);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #18201d;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16, 23, 20, 0.76), rgba(16, 23, 20, 0.22) 55%, rgba(16, 23, 20, 0.5));
}

.hero-overlay {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding: clamp(42px, 8vw, 96px) clamp(20px, 7vw, 88px);
  color: white;
}

.kicker,
.section-label {
  margin: 0 0 12px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .kicker {
  color: #f2c9a5;
}

.hero h1,
.page-title h1,
.project-hero h1 {
  margin: 0;
  max-width: 980px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 6vw, 5.8rem);
  line-height: 0.98;
  font-weight: 520;
}

.hero p:not(.kicker),
.project-hero p,
.lead {
  max-width: 720px;
  font-size: clamp(1.02rem, 1.45vw, 1.22rem);
  line-height: 1.65;
}

.content-band,
.page-title,
.resume-grid,
.portfolio-board,
.project-page,
.contact-layout,
.site-footer {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) 1fr;
  gap: clamp(24px, 5vw, 80px);
  padding: 72px 0 26px;
  align-items: end;
}

.intro-grid h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
}

.intro-grid > p,
.page-title h1 {
  margin: 0;
  line-height: 1.32;
}

.resume-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 22px 0 70px;
}

.info-panel,
.contact-card,
.admin-panel,
.login-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 35px rgba(32, 42, 37, 0.06);
}

.info-panel {
  min-height: 210px;
  padding: 24px;
}

.info-panel h3,
.contact-card h2,
.contact-card h3 {
  margin: 0 0 14px;
  font-size: 1.04rem;
}

.info-panel p,
.info-panel li,
.contact-card,
.tile-summary {
  color: var(--muted);
  line-height: 1.6;
}

.info-panel ul {
  margin: 0;
  padding-left: 18px;
}

.document-actions,
.download-strip {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 0 0 72px;
}

.page-title {
  padding: clamp(58px, 8vw, 96px) 0 32px;
}

.page-title.compact {
  max-width: 880px;
}

.home-contact-title {
  padding-top: 0;
}

.portfolio-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 18px 0 86px;
}

.project-tile {
  position: relative;
  min-height: 322px;
  display: grid;
  grid-template-rows: 230px auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-decoration: none;
  box-shadow: 0 8px 28px rgba(32, 42, 37, 0.08);
  transform-origin: center bottom;
  transition: transform 240ms ease, box-shadow 240ms ease, z-index 0ms linear 120ms;
}

.project-tile:hover,
.project-tile:focus-visible {
  z-index: 3;
  transform: scale(1.16) translateY(-12px);
  box-shadow: var(--shadow);
  transition-delay: 110ms;
}

.tile-image {
  overflow: hidden;
  background: #dfe3dc;
}

.tile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 360ms ease;
}

.project-tile:hover img {
  transform: scale(1.05);
}

.tile-title {
  padding: 15px 16px 4px;
  font-weight: 780;
  font-size: 1.05rem;
}

.tile-summary {
  padding: 0 16px 18px;
  font-size: 0.92rem;
}

.project-page {
  padding: 42px 0 86px;
}

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 0.7fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: end;
  margin-top: 22px;
}

.project-hero img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.project-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding-top: 52px;
}

.media-frame {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.media-frame img,
.media-frame video {
  width: 100%;
  display: block;
}

.pdf-frame iframe {
  width: 100%;
  height: min(760px, 78vh);
  border: 0;
}

.media-frame figcaption {
  padding: 11px 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.file-link {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  text-decoration: none;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.55fr) minmax(0, 1fr);
  gap: 18px;
  padding: 8px 0 86px;
}

.contact-card {
  padding: 26px;
}

.contact-card dl {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0 0 26px;
}

.contact-card dt {
  color: var(--muted);
}

.contact-card dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social-list a {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  text-decoration: none;
}

.map {
  width: 100%;
  min-height: 440px;
  border: 0;
  border-radius: 8px;
  background: white;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.error-state {
  width: min(720px, calc(100% - 36px));
  margin: 80px auto;
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .main-nav,
  .header-actions {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .intro-grid,
  .project-hero,
  .contact-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .hero {
    min-height: 660px;
  }

  .hero-overlay {
    padding: 92px 20px 42px;
  }

  .resume-grid,
  .portfolio-board {
    grid-template-columns: 1fr;
  }

  .project-tile:hover,
  .project-tile:focus-visible {
    transform: scale(1.03) translateY(-4px);
  }

  .contact-card dl {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
  }
}

.admin-body {
  background:
    linear-gradient(180deg, rgba(31, 111, 104, 0.08), transparent 290px),
    var(--paper);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-box {
  width: min(430px, 100%);
  display: grid;
  gap: 16px;
  padding: 30px;
}

.login-box h1,
.admin-header h1,
.admin-panel h2 {
  margin: 0;
}

.login-box label,
.admin-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.form-error {
  margin: 0;
  color: #a83232;
}

.admin-header {
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto;
  padding: 30px 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.admin-header-actions {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  cursor: pointer;
  border: 0;
}

.admin-layout {
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto 60px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}

.admin-sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.admin-sidebar button {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 720;
}

.admin-sidebar button.active {
  background: var(--ink);
  color: white;
}

.admin-sidebar .save-button {
  margin-top: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  justify-content: center;
  text-align: center;
  color: white;
}

.admin-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.admin-workspace {
  min-width: 0;
}

.admin-panel {
  display: grid;
  gap: 20px;
  padding: clamp(18px, 3vw, 30px);
}

.form-grid {
  display: grid;
  gap: 16px;
}

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

fieldset {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  color: var(--muted);
  font-weight: 720;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-grid input {
  width: auto;
  min-height: auto;
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.panel-title-row > div {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.danger {
  color: #9f2e2e;
}

.project-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.project-tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  font-weight: 700;
}

.project-tabs button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-list a,
.file-list span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.file-list button {
  padding: 5px 8px;
  border-radius: 6px;
  background: #f3e6df;
  color: #8c3d26;
}

.admin-help {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.backup-list {
  display: grid;
  gap: 10px;
}

.backup-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.backup-row span {
  overflow-wrap: anywhere;
  font-weight: 720;
}

@media (max-width: 820px) {
  .admin-header,
  .admin-layout {
    width: min(100% - 28px, 1280px);
  }

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

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

  .admin-sidebar {
    position: static;
  }

  .form-grid.two,
  .check-grid {
    grid-template-columns: 1fr;
  }
}
