:root {
  --bg: #faf7f2;
  --panel: #ffffff;
  --panel-soft: #fffaf7;
  --border: #e8e2da;
  --text: #1f2937;
  --muted: #6b7280;

  --accent: #ff6d6d;
  --accent-dark: #f25d5d;
  --accent-soft: #fff1f1;

  --green-dark: #1f3d3a;
  --shadow: 0 10px 30px rgba(31, 29, 27, 0.06);

  --radius: 16px;
  --sidebar-width: 176px;
  --content-max: 1180px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

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

/* ---------- PUBLIC LAYOUT ---------- */

.public-body {
  background: var(--bg);
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 32px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 700;
  font-size: 18px;
  color: var(--green-dark);
}

.logo {
  width: auto;
  height: 28px;
  flex: 0 0 auto;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.public-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.public-main {
  width: 100%;
}

.hero,
.page-section {
  width: min(100% - 32px, var(--content-max));
  margin: 0 auto;
}

.hero {
  padding: 56px 0 28px;
}

.hero h1 {
  margin: 0 0 14px;
  max-width: 760px;
  font-size: 54px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #17243a;
}

.hero p {
  margin: 0;
  max-width: 720px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.page-section {
  padding: 10px 0 28px;
}

.page-section h2 {
  margin: 0 0 16px;
  font-size: 36px;
  line-height: 1.1;
  color: #17243a;
}

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

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

.card,
.project-card,
.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.65);
}

.card h3,
.project-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.card p,
.project-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.thumb,
.preview-box {
  width: 100%;
  background: #ece5dc;
  border-radius: 12px;
}

.thumb {
  height: 140px;
  margin-bottom: 12px;
}

.preview-box {
  min-height: 420px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.public-footer {
  width: min(100% - 32px, var(--content-max));
  margin: 28px auto 40px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- BUTTONS ---------- */

button,
.primary-button,
.ghost-button,
.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: 0.16s ease;
}

button:hover,
.primary-button:hover,
.ghost-button:hover,
.button-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

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

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

.ghost-button {
  background: #fff;
}

.full {
  width: 100%;
}

/* ---------- FORMS / AUTH ---------- */

.auth-section {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  padding: 40px 16px;
}

.auth-card {
  width: min(100%, 420px);
  display: grid;
  gap: 14px;
}

.auth-card h1,
.auth-card h2 {
  margin: 0 0 6px;
}

.auth-card input,
.auth-card select,
.auth-card textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
}

.divider {
  text-align: center;
  color: var(--muted);
  margin: 2px 0;
}

/* ---------- APP LAYOUT ---------- */

.app-body {
  background: var(--bg);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sidebar .brand {
  font-size: 16px;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.sidebar-nav a {
  display: block;
  padding: 10px 10px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
}

.sidebar-nav a:hover {
  background: var(--accent-soft);
}

.sidebar-bottom {
  margin-top: auto;
  color: var(--muted);
  font-size: 13px;
}

.app-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.app-main {
  width: 100%;
  max-width: 1280px;
  padding: 28px 18px 40px;
}

.app-main h1 {
  margin: 0 0 18px;
  font-size: 52px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #17243a;
}

.app-main h2 {
  margin: 0 0 14px;
  font-size: 32px;
  line-height: 1.1;
  color: #17243a;
}

.app-main > * + * {
  margin-top: 20px;
}

/* ---------- SMALL UTILITIES ---------- */

.section-stack {
  display: grid;
  gap: 18px;
}

.two-col {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
}

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

/* ---------- RESPONSIVE ---------- */

@media (max-width: 1100px) {
  .card-grid,
  .project-grid,
  .three-col {
    grid-template-columns: 1fr 1fr;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 44px;
  }

  .app-main h1 {
    font-size: 42px;
  }
}

@media (max-width: 760px) {
  .public-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
  }

  .public-nav {
    gap: 16px;
  }

  .hero,
  .page-section,
  .public-footer {
    width: min(100% - 24px, var(--content-max));
  }

  .hero {
    padding: 36px 0 18px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .page-section h2 {
    font-size: 28px;
  }

  .card-grid,
  .project-grid,
  .three-col {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

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

  .app-main h1 {
    font-size: 34px;
  }
}
