/* ============================================================
   SUNSTONE — Main Stylesheet
   Fonts: Space Mono (navbar) · Lekton (body)
   Note: Iosevka Charon Mono not on Google Fonts;
         Space Mono is a close monospace alternative.
         Replace by self-hosting Iosevka if preferred.
   ============================================================ */

/* --- Reset & Base ------------------------------------------ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

body {
  height: 100%;
  font-family: 'Lekton', 'Courier New', monospace;
  font-size: 16px;
  color: #2c2c2c;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  overflow-y: auto;
}

/* --- Layout ------------------------------------------------- */

.layout {
  display: flex;
  min-height: 100%;
}

/* --- Left Panel --------------------------------------------- */

.panel-left {
  flex: 0 0 48%;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  align-self: flex-start;

  background-size: cover;
  background-color: #7a6e61;
}

/* Page-specific background images — defined in CSS so paths are
   always relative to this stylesheet, avoiding inline style issues */
.panel-left--home {
  background-image: url('../IMG_8332.jpeg');
  background-position: center 60%;
}

.panel-left--about {
  background-image: url('../Chanonry-010124-1.jpeg');
  background-position: 28% center;
}

.panel-left--work {
  background-image: url('../IMG_8336-2.jpeg');
  background-position: center 45%;
}

/* Subtle darkening overlay so the logo stays legible */
.panel-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
}

.panel-left__logo {
  position: absolute;
  bottom: 2.5rem;
  left: 2rem;
  right: 2rem;
  z-index: 1;
}

.panel-left__logo img {
  width: 100%;
  max-width: 340px;
  opacity: 0.55;
  display: block;
}

/* --- Right Panel -------------------------------------------- */

.panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 3rem 2.5rem 3.5rem;
  min-height: 100vh;
}

/* --- Navigation -------------------------------------------- */

.nav {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 2.5rem;
  width: 100%;
  font-family: 'Space Mono', 'Iosevka Charon Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.nav a {
  color: #2c2c2c;
  text-decoration: none;
}

.nav a:hover {
  color: #e08c00;
}

/* --- Main Content ------------------------------------------- */

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 440px;
  padding-top: 1rem;
}

.content__greeting {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
}

.content__intro {
  font-size: 0.9rem;
  line-height: 1.8;
  color: #3a3a3a;
  margin-bottom: 1.8rem;
}

.content__name {
  font-size: 0.875rem;
  font-style: italic;
  color: #6b6b6b;
  margin-bottom: 1.6rem;
}

.content__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.content__links a {
  font-size: 0.825rem;
  color: #2c2c2c;
  text-decoration: none;
  border-bottom: 1px solid #c8c0b4;
  padding-bottom: 0.15rem;
  transition: color 0.2s, border-color 0.2s;
}

.content__links a:hover {
  color: #e08c00;
  border-color: #e08c00;
}

/* --- Footer / Social --------------------------------------- */

.footer {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding-top: 1rem;
}

.footer a {
  display: flex;
  align-items: center;
  opacity: 0.55;
  transition: opacity 0.2s;
}

.footer a:hover {
  opacity: 1;
}

.footer img {
  height: 22px;
  width: auto;
  display: block;
}

/* --- Reversed layout (image right, text left) -------------- */

.layout--reversed {
  flex-direction: row-reverse;
}

.layout--reversed .panel-left__logo {
  left: auto;
  right: 2rem;
}

@media (max-width: 768px) {
  .layout--reversed {
    flex-direction: column;
  }
  .layout--reversed .panel-left__logo {
    left: 1.5rem;
    right: auto;
  }
}

/* --- Nav dropdown ------------------------------------------ */

.nav__dropdown {
  position: relative;
}

.nav__dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #ffffff;
  border: 1px solid #e8e2da;
  border-top: 2px solid #e08c00;
  min-width: 110px;
  z-index: 100;
  /* padding-top bridges the gap so the mouse stays inside the hover zone */
  padding: 0.5rem 0 0.3rem;
}

.nav__dropdown:hover .nav__dropdown-menu {
  display: block;
}

.nav__dropdown-menu a {
  display: block;
  padding: 0.45rem 1rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2c2c2c;
  text-decoration: none;
  white-space: nowrap;
}

.nav__dropdown-menu a:hover,
.nav__dropdown-menu a.nav--active {
  color: #e08c00;
}

/* --- Nav active state -------------------------------------- */

.nav a.nav--active {
  color: #e08c00;
}

/* --- Inner page content ------------------------------------ */

/* Shift content slightly higher on inner pages to
   accommodate the heading without losing the centred feel */
.content--page {
  justify-content: flex-start;
  padding-top: 3rem;
}

.content__heading {
  font-family: 'Space Mono', 'Iosevka Charon Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e08c00;
  margin-bottom: 1.8rem;
}

.content__body {
  font-size: 0.9rem;
  line-height: 1.8;
  color: #3a3a3a;
  margin-bottom: 1.2rem;
  max-width: 420px;
}

/* Work page: service list items */
.content__items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.4rem;
  padding-left: 0;
}

.content__items li {
  font-size: 0.875rem;
  color: #2c2c2c;
  padding-left: 1.2rem;
  position: relative;
}

.content__items li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: #e08c00;
}

/* Left panel as a link (about/work pages) */
a.panel-left {
  display: block;
  text-decoration: none;
  cursor: pointer;
}

/* --- Full-width page (Portfolio etc.) ---------------------- */

body.body--full {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Sticky header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 3rem;
  border-bottom: 2px solid #e08c00;
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 20;
  flex-shrink: 0;
}

.page-header__logo img {
  height: 26px;
  width: auto;
  display: block;
}

/* Inline nav (used inside page-header) */
.nav--inline {
  justify-content: flex-end;
  width: auto;
  flex-shrink: 0;
}

/* Page intro band */
.page-intro {
  border-bottom: 1px solid #e8e2da;
  flex-shrink: 0;
}

.page-intro__inner {
  padding: 1.8rem 3rem 1.5rem;
  max-width: 900px;
}

.page-intro__back {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.7rem;
}

.page-intro__back a {
  color: #6b6b6b;
  text-decoration: none;
}

.page-intro__back a:hover {
  color: #e08c00;
}

.page-intro__heading {
  font-family: 'Space Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e08c00;
  margin-bottom: 0.5rem;
  font-weight: 400;
}

.page-intro__sub {
  font-size: 0.875rem;
  line-height: 1.7;
  color: #6b6b6b;
  max-width: 560px;
}

/* Matrix wrapper — horizontally scrollable on narrow screens */
.matrix-wrap {
  padding: 2rem 3rem 3rem;
  overflow-x: auto;
  flex: 1;
}

/* Grid: first column is the narrow row-header, rest share equally */
.matrix {
  display: grid;
  grid-template-columns: 48px repeat(4, 1fr);
  min-width: 680px;
  border-top: 1px solid #e8e2da;
  border-left: 1px solid #e8e2da;
}

/* Corner cell */
.matrix__corner {
  border-right: 1px solid #e8e2da;
  border-bottom: 1px solid #e8e2da;
  background: #faf8f5;
}

/* Column headers */
.matrix__col-header {
  background: #e08c00;
  color: #ffffff;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.85rem 0.75rem;
  line-height: 1.4;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid #e8e2da;
}

/* Row headers — vertical text */
.matrix__row-header {
  background: #2c2c2c;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #e8e2da;
  border-bottom: 1px solid #e8e2da;
}

.matrix__row-header span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: #ffffff;
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Cells */
.matrix__cell {
  padding: 1.1rem 1rem 1.1rem 1.2rem;
  border-right: 1px solid #e8e2da;
  border-bottom: 1px solid #e8e2da;
  background: #ffffff;
  vertical-align: top;
}

.matrix__cell:hover {
  background: #faf8f5;
}

.matrix__cell ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.matrix__cell li {
  font-size: 0.78rem;
  line-height: 1.55;
  color: #3a3a3a;
  padding-left: 0.9rem;
  position: relative;
}

.matrix__cell li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.4em;
  width: 2px;
  height: 0.7em;
  background: #e08c00;
}

/* Full-width footer */
.footer--full {
  padding: 1.2rem 3rem;
  border-top: 1px solid #e8e2da;
  flex-shrink: 0;
}

/* --- Responsive -------------------------------------------- */

@media (max-width: 768px) {
  html, body {
    overflow: auto;
  }

  .layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .panel-left {
    flex: none;
    height: 40vh;
    min-height: 220px;
  }

  .panel-left__logo {
    bottom: 1.5rem;
    left: 1.5rem;
  }

  .panel-left__logo img {
    max-width: 220px;
  }

  .panel-right {
    padding: 2rem 1.5rem;
  }

  .nav {
    gap: 1.5rem;
    justify-content: flex-start;
  }

  .content {
    padding-top: 2rem;
    max-width: 100%;
  }
}
