/*
  Shared stylesheet for Sela's Creations.
  This file centralises styles that were previously repeated across pages.
  The card ratios, colour palette, and minimalist tone remain unchanged.
*/

/* root-level CSS variables accessed with var() */
:root {
  --bg: #090812;      /* main page background colour */
  --fg: #edebfa;      /* default text colour */
  --accent: #c13eff;  /* brand violet-magenta highlight */
  --accent2: #58fff6; /* cyan highlight */
  --accent3: #d6b676; /* gold (navigation link colour) */
  --muted: #a39cb6;   /* muted footer and secondary text */
  --text-box-width: 39rem;
                      /* landscape text width based on Home's longest line */
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
                      /* default site typeface stack */
}

/* universal selector matches all elements */
* {
  box-sizing: border-box; /* widths include padding + border */
}

/* basic layout reset for html and body */
html,
body {
  margin: 0;   /* removes default browser margin */
  padding: 0;  /* removes default browser padding */
  height: 100%;/* ensures document uses full viewport height */
  text-size-adjust: 100%; /* prevents mobile browsers enlarging text */
  -webkit-text-size-adjust: 100%; /* keeps iOS text from reflowing */
}

/* page background and general text layout */
body {
  min-height: 100vh; /* guarantees a full-height page */
  display: flex;     /* enables flexbox centering */
  align-items: center;     /* vertically centers the card */
  justify-content: center; /* horizontally centers the card */
  padding: 1.25rem;        /* protects the card edges on small screens */
  min-width: max-content;  /* lets fixed cards overflow instead of shrink */
  overflow: auto;          /* allows scrolling when a card is wider */
  background: radial-gradient(circle at top, #17132a, var(--bg));
                          /* soft circular gradient from top */
  color: var(--fg);       /* default text colour */
  font-family: var(--font); /* global font stack */
  line-height: 1.55;      /* readable line spacing */
  font-size: 1rem;        /* base font size */
}

/*
  main card shell used across pages.
  The default size is based on the Australian 90:55 business card ratio.
*/
main.card {
  text-align: center;                 /* centers text inside the card */
  padding: 2rem 2.25rem;              /* inner spacing around content */
  border-radius: 18px;                /* rounded corners */
  border: 2px solid rgba(193, 62, 255, 0.55);
                                      /* semi-transparent purple border */
  background: rgba(12, 10, 20, 0.9);  /* translucent dark card background */
  backdrop-filter: blur(12px);        /* blurs background behind the card */
  width: 450px;                      /* default fixed card width */
  aspect-ratio: 1.636 / 1;            /* Australian business-card ratio */
  flex: 0 0 auto;                     /* prevents flexbox from shrinking it */
  margin: 0;                          /* no outer margin */

  display: flex;           /* flex layout for vertical structure */
  flex-direction: column;  /* stacks nav, content, footer vertically */
  position: relative;      /* supports internal absolute positioning */
  overflow: hidden;        /* clips edges if transforms push outward */
}

/* card frame can reserve page-edge space without altering the card */
.card-frame {
  display: block;
  padding: 0 2rem;
  flex: 0 0 auto;
}

/* the entry page keeps its landscape card unframed */
main.card--home {
  border-width: 3px;
}

body:has(main.card--home) .card-frame {
  display: contents;
  padding: 0;
  border: 0;
}

/* wider card variant used by text-heavy pages */
main.card.card--wide {
  width: 810px; /* retains wider composition for About and Projects */
  border-width: 3px; /* matches the entry card border thickness */
}

/* shared navigation bar anchored to card top */
nav.site-nav {
  position: absolute; /* fixes nav relative to the card */
  top: 1.6rem;        /* default top spacing matches original layout */
  left: 50%;
  transform: translateX(-50%); /* centers nav horizontally */

  display: flex;           /* horizontal layout for links */
  flex-wrap: wrap;         /* allows clean wrap on narrower cards */
  justify-content: center; /* keeps wrapped rows centered */
  gap: 0.7rem 1.15rem;     /* row and column spacing */
  width: calc(100% - 2rem);
}

/* navigation link styling */
nav.site-nav a {
  text-decoration: none;      /* removes underlines */
  color: var(--accent3);      /* gold link colour */
  letter-spacing: 0.1em;      /* wide-spaced uppercase look */
  text-transform: uppercase;  /* forces links to all caps */
  font-size: 0.85rem;         /* compact, elegant link size */
  font-weight: 500;           /* medium weight */
  transition: color 180ms ease, opacity 180ms ease;
                          /* restrained interaction polish */
}

/* highlights the active page link */
nav.site-nav a.active {
  font-weight: 700; /* bold for the current page */
}

/* contact is a nav shortcut back to the Home contact block */
nav.site-nav a.site-nav-contact {
  display: inline;
}

/* subtle hover/focus states for keyboard and pointer users */
nav.site-nav a:hover,
nav.site-nav a:focus-visible,
a.text-link:hover,
a.text-link:focus-visible {
  color: #f3dca8; /* gentle warm lift from the existing gold tone */
  opacity: 0.95;
}

/* visible focus ring for accessibility without visual noise */
nav.site-nav a:focus-visible,
a.text-link:focus-visible {
  outline: 1px solid rgba(214, 182, 118, 0.5);
  outline-offset: 2px;
}

/* wrapper containing logo and its top offset */
.logo-wrap {
  position: absolute; /* fixes logo relative to the card */
  top: 3.15rem;       /* default logo distance for Home/404 rhythm */
  left: 50%;
  transform: translateX(-50%);
  width: min(90%, 420px);
  display: flex;
  justify-content: center;
  pointer-events: none; /* ensures the logo never blocks links */
}

/* entry page raises the brand block to make room for the entry link */
main.card--home .logo-wrap {
  top: 1rem;
}

/* logo media sizing rules keep the logo scaling as one unit */
.logo-wrap picture,
.logo-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

/* home and 404 center-line message styling */
.hero-line,
.error-title,
.error-sub,
.coming-soon {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* homepage tagline */
.hero-line {
  top: 9.9rem;
  font-size: 1rem;
  letter-spacing: 0.25rem;
  text-transform: uppercase;
  color: var(--accent2);
}

/* entry page tagline is lifted with the logo as a single visual group */
main.card--home .hero-line {
  top: 7.1rem;
  color: var(--accent3);
}

/* entry link invites visitors into the internal home page */
.enter-link {
  position: absolute;
  top: 10.8rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  border-radius: 18px;
  border: 2px solid var(--accent);
  background:
    linear-gradient(to right, #2a2148, transparent 18%, transparent 82%,
                   #2a2148),
    linear-gradient(to bottom, #2a2148, var(--bg) 50%, #2a2148);
  color: var(--accent2);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 400;
  transition: color 180ms ease, border-color 180ms ease;
  white-space: nowrap;
}

/* entry link text is nudged up inside the button without moving the box */
.enter-link::before {
  content: attr(data-label);
  transform: translateY(-0.08rem);
}

/* entry link uses the same restrained interaction polish as navigation */
.enter-link:hover,
.enter-link:focus-visible {
  border-color: rgba(214, 182, 118, 0.65);
  color: #f3dca8;
}

.enter-link:focus-visible {
  outline: 1px solid rgba(214, 182, 118, 0.5);
  outline-offset: 2px;
}

/* entry page footer sits a touch lower to balance the new button */
main.card--home .site-footer {
  bottom: 1.05rem;
}

/* 404 text styling */
.error-title {
  top: 9.4rem;
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent2);
}

.error-sub {
  top: 11.5rem;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: #e5d9ff;
}

/* 404 message is centred inside the shared project preview box */
.notfound-message {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: translateY(-0.5rem);
}

/* 404 message text follows its local message box, not the whole card */
.notfound-message .error-title,
.notfound-message .error-sub {
  position: static;
  left: auto;
  transform: none;
  white-space: normal;
}

.notfound-message .error-title {
  margin-bottom: 1rem;
}

/* simple centered placeholder note for project pages */
.coming-soon {
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 1rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent2);
}

/* Home directory replaces the placeholder with short section paths */
.home-directory {
  position: absolute;
  top: 9.8rem;
  bottom: 2.35rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 5rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* inner directory block uses a fixed position for visual consistency */
.home-directory-inner {
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: var(--text-box-width);
  text-align: left;
}

/* directory links are simple rows, not separate nested card elements */
.home-directory-link,
.home-contact {
  display: block;
  padding: 0.42rem 0;
  text-decoration: none;
}

/* first Home row starts directly at the top of the shared text box */
.home-directory-link:first-child {
  padding-top: 0;
}

/* directory titles use the existing gold navigation colour */
.home-directory-title {
  display: block;
  color: var(--accent2);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

/* directory descriptions stay quiet so the links remain easy to scan */
.home-directory-copy {
  display: block;
  margin-top: 0.12rem;
  color: #e5d9ff;
  font-size: 0.95rem;
  line-height: 1.35;
  white-space: nowrap;
}

.home-directory-link:hover .home-directory-title,
.home-directory-link:focus-visible .home-directory-title,
.home-contact .home-directory-title:hover,
.home-contact .home-directory-title:focus-visible {
  color: #f3dca8;
}

.home-directory-link:focus-visible,
.home-contact .home-directory-title:focus-visible {
  outline: 1px solid rgba(214, 182, 118, 0.5);
  outline-offset: 2px;
}

/* Home contact email uses body-copy colour until hovered or focused */
.home-contact .text-link {
  color: #e5d9ff;
  font-size: 0.95rem;
}

/* project preview box mirrors the temporary Home and About text area */
.project-preview-box {
  position: absolute;
  top: 9.8rem;
  bottom: 2.35rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 5rem);
}

/* project preview inner block keeps future text aligned for comparison */
.project-preview-inner {
  position: absolute;
  top: 2rem;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: var(--text-box-width);
  text-align: left;
}

/* temporary guide border marks the text area being visually adjusted */
.project-preview-inner--guide {
  border: 1px solid var(--accent2);
}

.project-preview-inner .coming-soon {
  top: 50%;
}

/* Programming placeholder sits a touch above the exact centre line */
.project-preview-inner .programming-coming-soon {
  top: calc(50% - 0.5rem);
}

/* screenwriting mock list scrolls inside the shared project text box */
.screenwriting-list {
  height: 100%;
  overflow-y: auto;
  padding-bottom: 1.35rem;
  padding-right: 0.8rem;
}

.screenwriting-list::-webkit-scrollbar {
  width: 0.45rem;
}

.screenwriting-list::-webkit-scrollbar-track {
  background-color: var(--bg);
  border-radius: 18px;
}

.screenwriting-list::-webkit-scrollbar-thumb {
  background: rgba(193, 62, 255, 0.18);
  background-color: rgba(193, 62, 255, 0.18);
  border-radius: 18px;
}

.screenwriting-list::-webkit-scrollbar-thumb:hover {
  background: rgba(193, 62, 255, 0.36);
  background-color: rgba(193, 62, 255, 0.36);
}

@supports (-moz-appearance: none) {
  .screenwriting-list {
    scrollbar-color: rgba(193, 62, 255, 0.32) var(--bg);
    scrollbar-width: thin;
  }
}

/* each mock entry leaves two quiet lines before the next title */
.screenwriting-item {
  margin: 0 0 2.7rem;
}

.screenwriting-item:last-child {
  margin-bottom: 0;
}

/* mock titles use the same cyan size as Home directory headings */
.screenwriting-item h2 {
  margin: 0 0 0.55rem;
  color: var(--accent2);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* each project preview keeps the title aligned with its detail group */
.screenwriting-details {
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
}

/* the temporary TV-ratio frame stands in for a future project image */
.screenwriting-preview {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--accent2);
  color: var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.6rem;
  height: 6.2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* descriptor rows sit to the right while keeping their left edge tidy */
.screenwriting-meta {
  text-align: left;
}

/* known project details use two quiet columns beside the preview frame */
.screenwriting-label,
.screenwriting-value {
  display: inline-block;
}

.screenwriting-label {
  width: 6.8rem;
}

/* mock project detail lines use the pale body-purpose text size */
.screenwriting-item p {
  margin: 0;
  color: #e5d9ff;
  font-size: 0.9rem;
  line-height: 1.35;
}

/* about text block */
.about-section {
  position: absolute;
  top: 9.8rem;
  bottom: 2.35rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 5rem);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e5d9ff;
  font-size: 0.95rem;
  text-align: left;
}

/* inner About block uses the same position as the Home directory text */
.about-inner {
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  width: var(--text-box-width);
  text-align: left;
}

/* About Me heading */
.about-section h1 {
  margin: 0 0 0.4rem;
  padding-top: 0;
  font-size: 1rem;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 400;
}

/* description copy can move independently from the About Me heading */
.about-copy {
  display: inline-block;
  padding-top: 0.68rem;
}

/* description paragraphs keep equal, slightly tighter vertical spacing */
.about-copy p {
  margin: 0;
}

.about-copy p + p {
  margin-top: 0.78rem;
}

/* footer at the bottom of the card */
footer.site-footer {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 1.5rem;
  white-space: nowrap;
  font-size: 0.6rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

/* inline text links, used for any future body links */
a.text-link {
  color: var(--accent3);
  text-decoration: none;
  transition: color 180ms ease, opacity 180ms ease;
}

/*
  page-specific offsets preserve the original vertical relationships.
  these offsets keep each page close to its pre-refactor visual rhythm.
*/
main.card--about .site-nav,
main.card--projects .site-nav {
  top: 2rem;
}

main.card--about .logo-wrap,
main.card--projects .logo-wrap {
  top: 4.15rem;
}

/*
  portrait mode rotates the business-card concept into a tall card.
  the original landscape layout above stays as the default experience.
*/
@media (orientation: portrait) {
  body {
    padding: 0.75rem 0;
    min-width: max-content;
    justify-content: center;
  }

  .card-frame {
    display: block;
    padding: 0 2rem;
    flex: 0 0 auto;
  }

  body:has(main.card--home) .card-frame {
    display: block;
    padding: 0 2rem;
    flex: 0 0 auto;
  }

  main.card.card--wide {
    width: 360px;
    aspect-ratio: 55 / 90;
    padding: 1.5rem;
  }

  /* entry page keeps the landscape business-card shape in portrait */
  main.card--home {
    width: 360px;
    aspect-ratio: 1.636 / 1;
    padding: 1.6rem 1.8rem;
  }

  nav.site-nav {
    display: grid;
    grid-template-columns: repeat(6, auto);
    top: 1.15rem;
    gap: 0.55rem 0.95rem;
    width: calc(100% - 2rem);
  }

  main.card--about .site-nav,
  main.card--projects .site-nav {
    top: 1.15rem;
  }

  nav.site-nav a {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    justify-self: center;
  }

  nav.site-nav a[href="home.html"]:not(.site-nav-contact) {
    grid-column: 1 / 3;
    grid-row: 1;
  }

  nav.site-nav a.site-nav-contact {
    display: inline;
    grid-column: 3 / 5;
    grid-row: 1;
  }

  nav.site-nav a[href="about.html"] {
    grid-column: 5 / 7;
    grid-row: 1;
  }

  nav.site-nav a[href="screenwriting.html"] {
    grid-column: 1 / 4;
    grid-row: 2;
  }

  nav.site-nav a[href="programming.html"] {
    grid-column: 4 / 7;
    grid-row: 2;
  }

  .logo-wrap,
  main.card--about .logo-wrap,
  main.card--projects .logo-wrap {
    top: 5.1rem;
    width: min(82%, 330px);
  }

  main.card--home .logo-wrap {
    top: 0.8rem;
    width: min(90%, 336px);
  }

  .hero-line {
    top: 11.35rem;
    font-size: 0.95rem;
    letter-spacing: 0.16rem;
  }

  main.card--home .hero-line {
    top: 5.68rem;
    font-size: 0.8rem;
    letter-spacing: 0.2rem;
  }

  .enter-link {
    top: 8.64rem;
    font-size: 0.64rem;
  }

  .home-directory,
  .about-section,
  .project-preview-box {
    top: 11.2rem;
    bottom: 3.5rem;
    width: calc(100% - 3rem);
    overflow-y: auto;
  }

  .home-directory-inner,
  .about-inner,
  .project-preview-inner {
    position: static;
    transform: none;
    width: calc(88% - 1rem);
    margin: 0 auto;
    text-align: left;
  }

  .home-directory {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .home-directory-copy {
    margin-top: 0.37rem;
    font-size: 0.875rem;
    white-space: normal;
  }

  .error-title,
  .coming-soon,
  .home-directory-title,
  .screenwriting-item h2,
  .about-section h1 {
    font-size: 0.95rem;
  }

  .error-sub,
  .home-contact .text-link,
  .about-section {
    font-size: 0.875rem;
  }

  .about-section {
    display: block;
    align-items: flex-start;
    padding-top: 0;
  }

  .about-copy {
    padding-top: 0.25rem;
  }

  .project-preview-inner {
    height: 100%;
  }

  .screenwriting-list {
    padding-right: 0.5rem;
  }

  .screenwriting-item p {
    font-size: 0.825rem;
  }

  .screenwriting-details {
    display: block;
  }

  .screenwriting-preview {
    margin: 0 auto 0.65rem;
  }

  .screenwriting-label {
    width: 5.8rem;
  }

  .screenwriting-preview,
  footer.site-footer {
    font-size: 0.55rem;
  }

  .error-title {
    top: 12rem;
  }

  .error-sub {
    top: 14rem;
    white-space: normal;
    width: calc(100% - 3rem);
  }

  footer.site-footer {
    bottom: 1.05rem;
    width: calc(100% - 2rem);
    white-space: normal;
  }

  main.card--home .site-footer {
    width: auto;
    white-space: nowrap;
  }
}
