:root {
  --blue: #1a4fa0;
  --blue-deep: #123a7a;
  --teal: #1aa7b8;
  --green: #5ec07f;
  --green-soft: #7dcf98;
  --bg: #f4f8fb;
  --bg-elevated: #ffffff;
  --bg-soft: #eef5f8;
  --line: rgba(26, 79, 160, 0.14);
  --text: #14304f;
  --muted: #5b738a;
  --danger: #d35a4a;
  --success: #2f9e5f;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(18, 58, 122, 0.10);
  --gradient: linear-gradient(110deg, var(--blue) 0%, var(--teal) 52%, var(--green) 100%);
  --font-display: "Montserrat", "Segoe UI", sans-serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(ellipse 70% 45% at 0% 0%, rgba(26, 79, 160, 0.10), transparent 55%),
    radial-gradient(ellipse 55% 40% at 100% 0%, rgba(94, 192, 127, 0.14), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 42%, #eaf3f7 100%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0 0.9rem;
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; }

.brand-logo {
  display: block;
  height: 64px;
  width: auto;
  max-width: min(280px, 62vw);
  object-fit: contain;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.site-nav a { color: var(--muted); }
.site-nav a:hover { color: var(--blue); }

.nav-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  margin-right: 0.35rem;
}

.nav-user-name { color: var(--blue-deep); font-size: 0.9rem; }
.nav-user-role {
  color: var(--teal);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-main { flex: 1; padding: 2.25rem 0 3rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.eyebrow {
  margin: 0 0 0.55rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
  font-family: var(--font-display);
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--blue-deep);
}

h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--blue);
}

.lede {
  margin: 1rem 0 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.25rem;
  align-items: center;
  min-height: min(58vh, 520px);
}

.hero-actions { margin-top: 1.75rem; }

.hero-panel { position: relative; min-height: 280px; }

.hero-glow {
  position: absolute;
  inset: 8% 4%;
  background: radial-gradient(circle, rgba(26, 167, 184, 0.22), transparent 70%);
  filter: blur(10px);
}

.hero-frame {
  position: relative;
  height: 100%;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(238, 245, 248, 0.92)),
    var(--bg-elevated);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.3rem;
  overflow: hidden;
}

.hero-frame::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--gradient);
}

.hero-logo {
  width: min(240px, 70%);
  height: auto;
  margin-bottom: 1.1rem;
}

.hero-frame-label {
  margin: 0;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

.hero-frame-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--blue-deep);
}

.hero-frame-note { margin: 0; color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.8rem 1.35rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 10px 24px rgba(26, 79, 160, 0.22);
}

.btn-sm { padding: 0.55rem 1rem; font-size: 0.9rem; }
.btn-block { width: 100%; }

.auth-section {
  display: grid;
  place-items: center;
  min-height: 55vh;
}

.auth-card {
  width: min(440px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--gradient);
}

.auth-logo {
  display: block;
  width: min(240px, 100%);
  height: auto;
  margin: 0.25rem 0 1.1rem;
}

.auth-card h1 {
  font-size: 1.85rem;
}

.auth-sub {
  margin: 0.5rem 0 1.4rem;
  color: var(--muted);
}

.auth-form { display: grid; gap: 1rem; }

.field { display: grid; gap: 0.4rem; }
.field span {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 600;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  padding: 0.8rem 0.9rem;
  font: inherit;
}

.field input:focus {
  outline: 2px solid rgba(26, 167, 184, 0.45);
  outline-offset: 1px;
  background: #fff;
}

.form-error,
.form-success {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
}

.form-error {
  background: rgba(211, 90, 74, 0.08);
  border: 1px solid rgba(211, 90, 74, 0.28);
  color: #a63a2d;
}

.form-success {
  background: rgba(47, 158, 95, 0.08);
  border: 1px solid rgba(47, 158, 95, 0.28);
  color: var(--success);
}

.section-intro { margin-bottom: 1.75rem; }

.project-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
  transition: border-color 160ms ease, transform 160ms ease;
  overflow: hidden;
  position: relative;
}

.project-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--gradient);
}

.project-card.is-open:hover {
  border-color: rgba(26, 167, 184, 0.45);
  transform: translateY(-2px);
}

.project-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.1rem;
  align-items: center;
  padding: 1.25rem 1.35rem 1.25rem 1.5rem;
}

.project-icon img {
  display: block;
  border-radius: 12px;
  background: #f3f8fb;
  object-fit: contain;
}

.project-icon.large img {
  border-radius: 16px;
  width: 360px;
  height: auto;
  max-height: 144px;
}

.project-body { display: grid; gap: 0.28rem; }

.project-meta {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.project-status,
.project-code {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  font-family: var(--font-display);
}

.project-status { color: var(--green); }
.project-code { color: var(--teal); }

.project-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 750;
  color: var(--blue-deep);
}

.project-summary,
.project-manager {
  color: var(--muted);
  line-height: 1.45;
}

.project-manager {
  font-size: 0.9rem;
  font-weight: 600;
}

.project-chevron {
  color: var(--teal);
  font-size: 1.4rem;
  font-weight: 700;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-weight: 600;
}

.back-link:hover { color: var(--blue); }

.detail-header {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1.75rem;
}

.detail-panels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-panels.two-col {
  grid-template-columns: 1fr 1fr;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: 0 10px 28px rgba(18, 58, 122, 0.06);
  padding: 1.25rem 1.35rem;
}

.panel-head { margin-bottom: 1rem; }

.panel-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.panel-hint {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.panel p,
.plain-list {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.plain-list { padding-left: 1.1rem; }
.plain-list li + li { margin-top: 0.4rem; }

.resource-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.resource-list a {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  transition: border-color 160ms ease, background 160ms ease;
}

.resource-list a:hover {
  border-color: rgba(26, 167, 184, 0.45);
  background: #fff;
}

.resource-title {
  font-weight: 700;
  color: var(--blue-deep);
}

.resource-note,
.resource-url {
  color: var(--muted);
  font-size: 0.88rem;
}

.resource-url {
  word-break: break-all;
  color: var(--teal);
}

.upload-form {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 860px) {
  .hero,
  .detail-panels,
  .detail-panels.two-col {
    grid-template-columns: 1fr;
  }

  .hero { min-height: 0; gap: 1.5rem; }
  .detail-header { flex-direction: column; }
  .project-link { grid-template-columns: auto 1fr; }
  .project-chevron { display: none; }
}

@media (max-width: 560px) {
  .page-shell { width: min(1120px, calc(100% - 1.5rem)); }
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .nav-user { align-items: flex-start; }
  .brand-logo { height: 52px; }
}
