:root {
  color-scheme: light;
  --ink: #161616;
  --muted: #64635f;
  --paper: #f7f5ef;
  --panel: #ffffff;
  --line: #dedbd2;
  --accent: #0f6f67;
  --accent-strong: #064f49;
  --sun: #d9a441;
  --clay: #a4553a;
  --danger: #a62929;
  --shadow: 0 22px 70px rgba(35, 31, 24, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 111, 103, 0.14);
}

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

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.2rem, 5vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.hidden {
  display: none !important;
}

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

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

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

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

.button.ghost {
  background: rgba(255, 255, 255, 0.68);
}

.link-button {
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.form-message {
  min-height: 24px;
  margin: 0;
  color: var(--accent-strong);
  font-weight: 700;
}

.form-message.error,
.savebar .error {
  color: var(--danger);
}

.access,
.admin-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.8fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(24px, 6vw, 76px) clamp(18px, 5vw, 64px);
}

.admin-login {
  grid-template-columns: minmax(320px, 620px);
  justify-content: center;
}

.login-panel {
  display: grid;
  gap: 18px;
  max-width: 560px;
  padding: clamp(24px, 4vw, 38px);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel p:not(.eyebrow) {
  color: var(--muted);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(18px, 5vw, 64px);
  background: rgba(247, 245, 239, 0.9);
  border-bottom: 1px solid rgba(222, 219, 210, 0.8);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  width: 26px;
  height: 26px;
  display: inline-block;
  background:
    linear-gradient(135deg, transparent 44%, var(--paper) 45% 55%, transparent 56%),
    linear-gradient(135deg, var(--accent), var(--sun));
  border-radius: 6px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 3vw, 30px);
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a:hover,
.link-button:hover {
  color: var(--ink);
}

.hero {
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 6vw, 76px) clamp(18px, 5vw, 64px);
}

.hero-media,
.access-media {
  position: relative;
  min-height: 520px;
}

.render {
  position: absolute;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.render::before,
.render::after {
  position: absolute;
  content: "";
  inset: 0;
}

.render::before {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.18) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(rgba(255,255,255,0.14) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(135deg, rgba(255,255,255,0.22), rgba(255,255,255,0));
}

.render::after {
  background:
    radial-gradient(circle at 76% 18%, rgba(217,164,65,0.8) 0 5%, transparent 6%),
    linear-gradient(145deg, rgba(20,20,20,0) 45%, rgba(20,20,20,0.28)),
    linear-gradient(100deg, rgba(6,79,73,0.88), rgba(164,85,58,0.68));
}

.render-main {
  inset: 22px 7% 24px 0;
}

.render-side {
  right: 0;
  width: 38%;
  height: 38%;
  background: #ddd3c4;
}

.render-side.top {
  top: 0;
}

.render-side.bottom {
  bottom: 0;
}

.hero-copy {
  max-width: 640px;
}

.hero-copy p,
.steps p,
.contact p {
  color: var(--muted);
}

.section {
  padding: clamp(42px, 7vw, 92px) clamp(18px, 5vw, 64px);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

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

.filter {
  min-height: 38px;
  padding: 0 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.filter.active,
.filter:hover {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.project-card {
  grid-column: span 4;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(35, 31, 24, 0.08);
}

.project-card.large {
  grid-column: span 8;
}

.thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  background: #d7d1c5;
}

.project-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
}

.project-info p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.tag {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  color: var(--muted);
  background: rgba(255,255,255,0.64);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.steps article {
  min-height: 210px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.steps span {
  display: inline-block;
  margin-bottom: 40px;
  color: var(--clay);
  font-weight: 900;
}

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(42px, 7vw, 86px) clamp(18px, 5vw, 64px);
  color: #fff;
  background:
    linear-gradient(110deg, rgba(6,79,73,0.94), rgba(22,22,22,0.86)),
    linear-gradient(90deg, var(--accent), var(--clay));
}

.contact > div {
  max-width: 760px;
}

.contact .eyebrow,
.contact p {
  color: rgba(255, 255, 255, 0.76);
}

.contact .button {
  flex: 0 0 auto;
  background: #fff;
  color: var(--accent-strong);
  border-color: #fff;
}

.instagram-link {
  display: inline-flex;
  margin-top: 14px;
  color: #fff;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.lightbox {
  width: min(1080px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  overflow: hidden;
  background: #111;
  border: 0;
  border-radius: 8px;
  color: #fff;
}

.lightbox::backdrop {
  background: rgba(10, 10, 10, 0.74);
}

.lightbox img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  display: block;
  background: #050505;
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.48);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}

.lightbox-caption {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
}

.lightbox-caption span {
  color: rgba(255, 255, 255, 0.68);
}

.message-modal {
  width: min(520px, calc(100vw - 28px));
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.message-modal::backdrop {
  background: rgba(10, 10, 10, 0.52);
}

.message-modal .close {
  color: var(--ink);
  background: rgba(255,255,255,0.82);
  border-color: var(--line);
}

.message-form {
  display: grid;
  gap: 16px;
  padding: clamp(22px, 5vw, 34px);
}

.message-form h2 {
  margin-bottom: 0;
}

.message-form textarea {
  min-height: 140px;
}

.admin-shell {
  min-height: 100vh;
}

.admin-panel {
  padding: clamp(22px, 5vw, 54px);
}

.admin-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.admin-actions,
.inline-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
  gap: 18px;
}

.editor-section {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 22px;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.editor-section.full,
.savebar {
  grid-column: 1 / -1;
}

.editor-section h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

.project-editor-list,
.step-editor-list {
  display: grid;
  gap: 14px;
}

.project-editor {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 16px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.editor-preview {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--muted);
  background: #ece7db;
  border-radius: 8px;
  overflow: hidden;
}

.editor-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-fields {
  display: grid;
  gap: 12px;
}

.file-control input {
  padding: 8px;
  background: #fff;
}

.remove-project {
  color: var(--danger);
}

.step-editor {
  display: grid;
  grid-template-columns: 110px minmax(180px, 0.7fr) minmax(260px, 1fr);
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.savebar {
  position: sticky;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  background: rgba(247,245,239,0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(16px);
}

.savebar p {
  margin: 0;
  color: var(--accent-strong);
  font-weight: 800;
}

@media (max-width: 920px) {
  .access,
  .hero,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .access-media,
  .hero-media {
    min-height: 380px;
    order: -1;
  }

  .section-heading,
  .contact,
  .admin-header,
  .savebar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .project-card,
  .project-card.large {
    grid-column: span 6;
  }

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

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    flex-wrap: wrap;
    font-size: 0.88rem;
  }

  .access-media,
  .hero-media {
    min-height: 300px;
  }

  .render-main {
    right: 0;
  }

  .render-side {
    display: none;
  }

  .project-card,
  .project-card.large {
    grid-column: 1 / -1;
  }

  .project-info,
  .lightbox-caption {
    align-items: flex-start;
    flex-direction: column;
  }
}
