:root {
  --bg: #0f0f10;
  --text: #e9e9ea;
  --muted: #b7b7bb;
  --light-bg: #ffffff;
  --light-text: #111;
  --accent: #e0722e;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* CHAPTER SYSTEM */

.chapter {
  position: relative;
  padding: 14vh 8vw;
}

.chapter.light {
  background: var(--light-bg);
  color: var(--light-text);
}

.chapter.dark {
  background: #161618;
}

.ship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
  margin-top: 40px;
}

.ship h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.ship p {
  font-size: 14px;
  opacity: 0.75;
  line-height: 1.5;
}

.ship-note {
  margin-top: 40px;
  font-size: 14px;
  opacity: 0.6;
}

.ship .links {
  margin-top: 10px;
  font-size: 13px;
}

.ship .links a {
  opacity: 0.7;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.ship .links a:hover {
  opacity: 1;
}

/* HERO */

.hero {
  display: flex;
  align-items: center;
  min-height: 100vh;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero .sub {
  margin-top: 24px;
  color: var(--muted);
}

/* INNER WIDTHS */

.inner {
  max-width: 1100px;
  margin: 0 auto;
}

.inner.narrow {
  max-width: 720px;
}

/* TYPOGRAPHY */

h2 {
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.2;
  margin-bottom: 24px;
}

h3 {
  font-size: clamp(22px, 2.4vw, 30px);
  margin-bottom: 10px;
}

.lead {
  color: var(--muted);
}

.meta {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

p {
  margin: 12px 0;
}

.links {
  margin-top: 18px;
  font-size: 14px;
}

.links a {
  color: var(--accent);
  text-decoration: none;
}

.links a:hover {
  text-decoration: underline;
}

/* PROJECT LAYOUT */

.project {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 6vw;
  align-items: center;
}

.project .media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

/* ABOUT */

.about {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 40px;
  align-items: center;
}

.about img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 100%;
}

/* BUTTON */

.button {
  display: inline-block;
  padding: 14px 22px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 4px;
}

/* END HERO */

.end {
  text-align: center;
}

/* RESPONSIVE */

@media (max-width: 900px) {
  .project {
    grid-template-columns: 1fr;
  }

  .about {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about img {
    margin: 0 auto;
  }
}

/* -------------------------------------------------- */
/* SVG TILE BACKGROUNDS – FIXED FOR LIGHT/DARK */
/* -------------------------------------------------- */

/* base colors */
.chapter.light {
  --section-bg: #ffffff;
  color: var(--light-text);
}

.chapter.dark {
  --section-bg: #161618;
}

/* pattern helpers */
.bg-grid {
  --pattern: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23444444' stroke-width='1'%3E%3Cpath d='M40 0H0V40'/%3E%3C/g%3E%3C/svg%3E");
  --size: 40px 40px;
}

.bg-dots {
  --pattern: url("data:image/svg+xml,%3Csvg width='28' height='28' viewBox='0 0 28 28' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23555555'/%3E%3C/svg%3E");
  --size: 28px 28px;
}

.bg-lines {
  --pattern: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 59L59 0' stroke='%23444444' stroke-width='1' fill='none'/%3E%3C/svg%3E");
  --size: 60px 60px;
}

.bg-cross {
  --pattern: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 6V26M6 16H26' stroke='%23eeeeee' stroke-width='1'/%3E%3C/svg%3E");
  --size: 32px 32px;
}

.bg-waves {
  --pattern: url("data:image/svg+xml,%3Csvg width='80' height='40' viewBox='0 0 80 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 20 Q20 0 40 20 T80 20' stroke='%23333333' fill='none' stroke-width='1'/%3E%3C/svg%3E");
  --size: 80px 40px;
}

/* apply */
.chapter[class*="bg-"] {
  background-color: var(--section-bg, var(--bg));
  background-image: var(--pattern);
  background-size: var(--size);
}