/*
Theme Name: Trinsic
Theme URI: https://trinsicstudios.com/
Author: Trinsic Studios
Description: The Trinsic Studios site. A fixed side panel with the logo, a scrolling column of game and app cards, and an animated linked mesh behind it all. Cards are managed under Games & Apps in the dashboard.
Version: 1.0.1
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: trinsic
*/

:root {
  --paper: #fdfdfc;
  --card: #ffffff;
  --ink: #17181c;
  --mute: #6b6e78;
  --line: #e3e3e0;
  --teal: #2fb5a8;
  --coral: #ff6a55;
  --amber: #efb22a;
  --indigo: #5a67f2;
  --display: "Josefin Sans", "Century Gothic", sans-serif;
  --body: "Newsreader", Georgia, serif;
  --side: 33.333vw;
  --pad: clamp(26px, 3.6vw, 60px);
  --bar: 0px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a { color: inherit; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed !important;
  z-index: 100;
  top: 8px; left: 8px;
  width: auto; height: auto;
  margin: 0; padding: 10px 14px;
  clip: auto;
  background: var(--ink);
  color: #fff;
  font-family: var(--display);
}

#mesh {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* the dashboard toolbar, when signed in */
.admin-bar { --bar: 32px; }
@media (max-width: 782px) { .admin-bar { --bar: 46px; } }

/* ---------- left third: fixed ---------- */

.side {
  position: fixed;
  z-index: 2;
  top: var(--bar); bottom: 0; left: 0;
  width: var(--side);
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--line);
}

.side > * { animation: trinsic-rise .8s cubic-bezier(.2, .7, .2, 1) backwards; }
.side__logo { animation-delay: .05s; }
.side__tag  { animation-delay: .2s; }
.side__copy { animation-delay: .3s; }
.side__nav  { animation-delay: .4s; }
.side__foot { animation-delay: .5s; }
@keyframes trinsic-rise { from { opacity: 0; transform: translateY(16px); } }

.side__logo { display: block; width: min(100%, 340px); }
.side__logo img { display: block; width: 100%; height: auto; }

.side__tag {
  margin: clamp(26px, 5vh, 52px) 0 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(24px, 2.5vw, 38px);
  line-height: 1.12;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.side__copy {
  margin: 16px 0 0;
  max-width: 30ch;
  color: var(--mute);
  font-size: clamp(16px, 1.25vw, 19px);
}

.side__nav {
  margin-top: clamp(26px, 5vh, 52px);
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.side__nav a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 13px 0 9px;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 15px;
  color: var(--mute);
  transition: color .2s, padding-left .3s cubic-bezier(.2, .7, .2, 1);
}
.side__nav b { font-weight: 400; font-size: 12px; color: var(--coral); letter-spacing: .08em; }
.side__nav span { flex: 1; }
.side__nav i { font-style: normal; font-size: 12px; letter-spacing: .08em; }
.side__nav a:hover, .side__nav a:focus-visible, .side__nav a.is-here { color: var(--ink); padding-left: 10px; }
.side__nav a.is-here span { font-weight: 600; }

.side__foot {
  margin-top: auto;
  padding-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mute);
}
.side__links { display: contents; margin: 0; padding: 0; list-style: none; }
.side__links li { display: contents; }
.side__foot a { text-decoration: none; border-bottom: 1px solid var(--line); }
.side__foot a:hover, .side__foot a:focus-visible { color: var(--ink); border-color: var(--ink); }
.side__foot > span { flex-basis: 100%; margin-top: 6px; font-size: 11px; }

/* ---------- right two-thirds: scrolls ---------- */

.main {
  position: relative;
  z-index: 1;
  margin-left: var(--side);
  padding: var(--pad);
  padding-bottom: 40px;
  min-height: calc(100vh - var(--bar));
  display: flex;
  flex-direction: column;
}

.section {
  width: 100%;
  max-width: 1040px;
  padding-bottom: clamp(56px, 8vw, 104px);
  scroll-margin-top: calc(var(--pad) + var(--bar));
}

.section__head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 16px;
  margin-bottom: 26px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink);
}
.section__head--plain { grid-template-columns: 1fr; }
.section__no {
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: .1em;
  color: var(--coral);
}
.section__head h1,
.section__head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(30px, 3.6vw, 52px);
  line-height: 1.05;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.section__head p { grid-column: 2; margin: 8px 0 0; color: var(--mute); }

.grid { display: grid; gap: 20px; }
.grid--cols { grid-template-columns: repeat(3, 1fr); }
.grid--rows { grid-template-columns: 1fr; gap: 16px; }

/* ---------- cards ---------- */

.card {
  --accent: var(--teal);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 3px;
  text-decoration: none;
  overflow: hidden;
  transition: opacity .6s, transform .6s cubic-bezier(.2, .7, .2, 1), box-shadow .25s, border-color .25s;
}
.card:nth-child(4n + 2) { --accent: var(--coral); }
.card:nth-child(4n + 3) { --accent: var(--amber); }
.card:nth-child(4n + 4) { --accent: var(--indigo); }

/* entrance: only when the script that reveals cards is running */
.js .card { opacity: 0; transform: translateY(18px); }
.js .card.is-in { opacity: 1; transform: none; }

.card:hover, .card:focus-visible {
  transform: translate(-4px, -4px);
  box-shadow: 8px 8px 0 var(--accent);
  border-color: var(--ink);
  outline: none;
}
.js .card:not(.is-in):hover { transform: translateY(18px); box-shadow: none; }
.js .card.is-in:hover, .js .card.is-in:focus-visible {
  transform: translate(-4px, -4px);
  transition: opacity .6s, transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s, border-color .25s;
}

.card__shot {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f1f1ef;
  border-bottom: 1px solid var(--line);
}
.card__shot img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.card:hover .card__shot img, .card:focus-visible .card__shot img { transform: scale(1.04); }

.card__body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 15px; }
.card__kicker {
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--coral);
}
.card__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: .02em;
}
.card__text { margin: 0; color: var(--mute); font-size: 16px; line-height: 1.45; }

.card__foot {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.tags { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--mute); }
.tag { display: inline-flex; align-items: center; gap: 6px; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.card__go { white-space: nowrap; font-weight: 600; }
.card__go em { font-style: normal; display: inline-block; transition: transform .25s; }
.card:hover .card__go em, .card:focus-visible .card__go em { transform: translateX(5px); }

/* headline card: picture beside text */
.card--headline { grid-column: 1 / -1; flex-direction: row; }
.card--headline .card__shot { flex: 0 0 58%; aspect-ratio: 16 / 10; border-bottom: 0; border-right: 1px solid var(--line); }
.card--headline .card__body { padding: clamp(20px, 2.6vw, 36px); justify-content: center; gap: 10px; }
.card--headline .card__title { font-weight: 300; font-size: clamp(30px, 3.2vw, 46px); letter-spacing: .08em; text-transform: uppercase; }
.card--headline .card__text { font-size: 18px; }
.card--headline .card__foot { margin-top: 8px; }

/* rows: picture beside text */
.card--row { flex-direction: row; align-items: stretch; }
.card--row .card__shot { flex: 0 0 230px; aspect-ratio: 16 / 10; border-bottom: 0; border-right: 1px solid var(--line); }
.card--row .card__shot img { object-position: 0 0; }
.card--row .card__body { justify-content: center; }
.card--row .card__title { font-size: 22px; }

.main__foot {
  width: 100%;
  max-width: 1040px;
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mute);
}
.main__foot a { text-decoration: none; }
.main__foot a:hover { color: var(--ink); }

a:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; }

/* ---------- pages and posts (About, Contact, anything written in the editor) ---------- */

.entry__content {
  max-width: 68ch;
  padding: clamp(20px, 3vw, 40px);
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 18px;
  line-height: 1.6;
}
.entry__content > :first-child { margin-top: 0; }
.entry__content > :last-child { margin-bottom: 0; }
.entry__content h1, .entry__content h2, .entry__content h3, .entry__content h4 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: .06em;
  line-height: 1.2;
  margin: 1.6em 0 .5em;
}
.entry__content h2 { font-size: 28px; text-transform: uppercase; font-weight: 300; }
.entry__content h3 { font-size: 22px; }
.entry__content a { text-decoration: underline; text-decoration-color: var(--coral); text-underline-offset: 3px; }
.entry__content a:hover { color: var(--coral); }
.entry__content blockquote { margin: 1.4em 0; padding-left: 18px; border-left: 3px solid var(--teal); color: var(--mute); font-style: italic; }
.entry__content img { border-radius: 3px; }
.entry__content .alignwide, .entry__content .alignfull { max-width: 100%; }

.entry__content label { display: block; font-family: var(--display); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.entry__content input[type="text"],
.entry__content input[type="email"],
.entry__content input[type="url"],
.entry__content input[type="tel"],
.entry__content input[type="search"],
.entry__content select,
.entry__content textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  transition: border-color .2s, box-shadow .2s;
}
.entry__content input:focus, .entry__content select:focus, .entry__content textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--teal);
}
.entry__content input[type="submit"],
.entry__content button[type="submit"],
.entry__content .wp-element-button {
  display: inline-block;
  padding: 13px 26px 10px;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 3px;
  color: #fff;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.entry__content input[type="submit"]:hover,
.entry__content button[type="submit"]:hover,
.entry__content .wp-element-button:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--coral); }

.entry-list__item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.entry-list__item h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 22px; }
.entry-list__item h2 a { text-decoration: none; }
.entry-list__item h2 a:hover { color: var(--coral); }
.entry-list__date { margin: 4px 0 0; font-family: var(--display); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.nav-links { display: flex; gap: 10px; margin-top: 24px; font-family: var(--display); }

/* ---------- responsive ---------- */

@media (max-width: 1180px) {
  .grid--cols { grid-template-columns: repeat(2, 1fr); }
  .card--headline { flex-direction: column; }
  .card--headline .card__shot { flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
}

/* below this width the split stops making sense: the side panel becomes a header */
@media (max-width: 820px) {
  .side {
    position: relative;
    top: 0;
    width: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 22px;
  }
  .side__logo { width: min(64%, 260px); }
  .side__nav { flex-direction: row; flex-wrap: wrap; border-top: 0; gap: 6px 18px; margin-top: 22px; }
  .side__nav a { border-bottom: 0; padding: 4px 0; gap: 6px; font-size: 13px; letter-spacing: .1em; }
  .side__nav a:hover, .side__nav a.is-here { padding-left: 0; }
  .side__nav i { display: none; }
  .side__foot { margin-top: 18px; padding-top: 0; }
  .main { margin-left: 0; min-height: 0; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .grid { gap: 12px; }
  .grid--cols .card:not(.card--headline) .card__body { padding: 12px 12px 11px; }
  .grid--cols .card:not(.card--headline) .card__title { font-size: 16px; }
  .grid--cols .card:not(.card--headline) .card__go { display: none; }
  .card--row { flex-direction: column; }
  .card--row .card__shot { flex: none; border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .card { opacity: 1; transform: none; }
}
