/* ==========================================================================
   Squam Lakes Investment Management — site stylesheet
   One file styles every page. Colors and type sizes are set once, as tokens,
   in the first block; change a value there and it changes everywhere.
   ========================================================================== */

/* ==========================================================================
   Typefaces
   The four font files ship with the site, in the fonts folder, so a visitor's browser never has
   to contact another company's server before it can draw the text. "swap" shows the words at
   once in a typeface already on the device and switches when the file arrives.
   ========================================================================== */
@font-face {
  font-family: "Libre Caslon Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/libre-caslon-display-400.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Caslon Text";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/libre-caslon-text-400.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Caslon Text";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/libre-caslon-text-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Libre Caslon Text";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/libre-caslon-text-700.woff2") format("woff2");
}

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  /* Layout idea: the firm's letterhead made into a site. One serif family, hairline rules,
     a label column beside each section, photographs tucked behind overlapping text panels. */
  --paper: #DEEBF2;                    /* page background: light blue */
  --ink: #323B59;                      /* text: slate navy */
  --ink-soft: #4A5573;                 /* labels and secondary text */
  --rule: rgba(50, 59, 89, 0.28);      /* hairlines */
  --panel: rgba(180, 205, 220, 0.88);  /* text panels that overlap a photograph */
  --field: #EEF5F9;                    /* form fields and hover fills */
  --photo: #A9BFCE;                    /* tint shown while a photograph loads */

  /* Logo artwork */
  --loon: #191919;
  --wave-1: #989898;
  --wave-2: #AEAEAE;
  --wave-3: #C1C1C1;
  --wave-4: #D7D7D7;

  /* 1 when that theme is showing, 0 when it is not (drives the Light/Dark control) */
  --is-light: 1;
  --is-dark: 0;

  --font-display: "Libre Caslon Display", "Libre Caslon Text", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-text: "Libre Caslon Text", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  /* Type scale */
  --text-label: 0.75rem;
  --text-small: 0.875rem;
  --text-body: clamp(1.0625rem, 1.02rem + 0.2vw, 1.1875rem);
  --text-lede: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --text-title: clamp(1.625rem, 1.3rem + 1.5vw, 2.375rem);
  --text-name: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --text-display: clamp(2rem, 1.25rem + 3.6vw, 4rem);

  --gutter: clamp(1.25rem, 5vw, 3rem);
  --space-section: clamp(3rem, 8vw, 6rem);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #323B59;
    --ink: #DEEBF2;
    --ink-soft: #B7C5D4;
    --rule: rgba(222, 235, 242, 0.28);
    --panel: rgba(35, 42, 65, 0.88);
    --field: #283049;
    --photo: #46506F;
    --loon: #DEEBF2;
    --wave-1: #9AA6B8;
    --wave-2: #828DA3;
    --wave-3: #6D7890;
    --wave-4: #5B6680;
    --is-light: 0;
    --is-dark: 1;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #323B59;
  --ink: #DEEBF2;
  --ink-soft: #B7C5D4;
  --rule: rgba(222, 235, 242, 0.28);
  --panel: rgba(35, 42, 65, 0.88);
  --field: #283049;
  --photo: #46506F;
  --loon: #DEEBF2;
  --wave-1: #9AA6B8;
  --wave-2: #828DA3;
  --wave-3: #6D7890;
  --wave-4: #5B6680;
  --is-light: 0;
  --is-dark: 1;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
  text-wrap: balance;
}

h2 {
  margin-bottom: 1rem;
  font-size: var(--text-title);
}

p {
  max-width: 62ch;
  margin: 0 0 1em;
  text-wrap: pretty;
}

p:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

[hidden] { display: none !important; }

.nowrap { white-space: nowrap; }

.wrap {
  width: min(100%, 76rem);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  top: -5rem;
  left: var(--gutter);
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--text-small);
}

.skip-link:focus { top: 0.75rem; }

/* Small letterspaced caps, used for section labels */
.label {
  margin: 0;
  color: var(--ink-soft);
  font-size: var(--text-label);
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.button {
  display: inline-block;
  padding: 0.95rem 1.75rem;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.button:hover {
  background: transparent;
  color: var(--ink);
}

.button:disabled {
  opacity: 0.6;
  cursor: default;
}

.tagline {
  margin: 0;
  font-size: var(--text-lede);
  font-style: italic;
  line-height: 1.3;
}

/* ==========================================================================
   Masthead
   ========================================================================== */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-block: 0.875rem;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: block;
  flex: none;
  width: 2.75rem;
  height: auto;
}

.brand-name {
  font-family: var(--font-display);
  font-size: clamp(0.9375rem, 0.72rem + 1.05vw, 1.5rem);
  line-height: 1.15;
}

/* The name may break only between "Squam Lakes" and "Investment Management" */
.brand-name span { white-space: nowrap; }

.theme-toggle {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.35em;
  min-height: 2.75rem;
  padding: 0 0.125rem;
  border: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

/* The theme now showing is full strength and underlined; the other is dimmed */
.theme-toggle [data-mode] {
  padding-bottom: 2px;
  background: linear-gradient(currentColor, currentColor) left bottom / calc(var(--on) * 100%) 1px no-repeat;
  opacity: calc(0.6 + 0.4 * var(--on));
  transition: opacity 0.2s ease, background-size 0.2s ease;
}

.theme-toggle [data-mode="light"] { --on: var(--is-light); }
.theme-toggle [data-mode="dark"] { --on: var(--is-dark); }

@media (max-width: 22.4rem) {
  .brand-name span { white-space: normal; }
}

@media (min-width: 40rem) {
  .masthead { padding-block: 1.25rem; }
  .brand { gap: 0.875rem; }
  .brand-mark { width: 4rem; }
  .theme-toggle { font-size: var(--text-label); }
}

/* ==========================================================================
   Home: hero
   ========================================================================== */
.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(2rem, 5vw, 3.5rem); }

.hero h1 {
  max-width: 17em;
  font-size: var(--text-display);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-top: clamp(1.25rem, 3vw, 1.75rem);
  border-top: 1px solid var(--rule);
}

/* ==========================================================================
   Photographs
   The frame sets the shape; the image always fills it and is cropped to fit.
   ========================================================================== */
.photo {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--photo);
}

.photo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   Feature: a photograph with a text panel overlapping its edge
   ========================================================================== */
.feature {
  display: grid;
  margin-bottom: var(--space-section);
}

.panel {
  position: relative;
  z-index: 1;
  margin: -2.5rem 1rem 0;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--panel);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.panel .label { margin-bottom: 0.75rem; }

/* The painting: wide, with the panel over its lower right corner */
.feature--art > .photo { aspect-ratio: 3 / 2; }

/* A wide photograph with a broad panel across its lower edge; on wide screens the
   panel's three points sit side by side */
.feature--band > .photo { aspect-ratio: 3 / 2; }

/* The tall photograph: beside its panel on wide screens, above it on narrow ones.
   Its top is kept in view so both faces stay in the frame. */
.feature--side > .photo {
  width: min(100%, 30rem);
  aspect-ratio: 4 / 5;
}

.feature--side > .photo img { object-position: 50% 8%; }

@media (min-width: 56rem) {
  .feature { grid-template-columns: repeat(12, minmax(0, 1fr)); }

  .feature--art > .photo {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
  }

  .feature--art > .panel {
    grid-column: 6 / -1;
    margin: -10rem 0 0;
  }

  .feature--band > .photo {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
  }

  .feature--band > .panel {
    grid-column: 1 / -1;
    margin: -8rem 2.5rem 0;
  }

  .feature--band .points {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
    font-size: 1rem;
  }

  .feature--side {
    align-items: center;
    margin-block: 2.5rem calc(var(--space-section) + 2.5rem);
  }

  .feature--side > .photo {
    grid-row: 1;
    grid-column: 1 / span 6;
    align-self: stretch;
    width: auto;
    aspect-ratio: auto;
    margin: -2.5rem 0;
  }

  .feature--side > .photo img { object-position: 50% 50%; }

  /* The panel laps over the photograph's right edge only slightly, clear of both faces */
  .feature--side > .panel {
    grid-row: 1;
    grid-column: 7 / -1;
    margin: 0 0 0 -3.5rem;
  }
}

/* ==========================================================================
   Sections: a label column beside the content
   ========================================================================== */
.section {
  display: grid;
  gap: 0.75rem;
  padding-block: var(--space-section);
  border-top: 1px solid var(--rule);
}

/* The opening section of an inside page: no rule above, a larger heading */
.section--page {
  padding-top: clamp(2.5rem, 7vw, 5.5rem);
  border-top: 0;
}

.page-title {
  margin-bottom: 1.1rem;
  font-size: var(--text-name);
}

@media (min-width: 56rem) {
  .section {
    grid-template-columns: 13rem minmax(0, 1fr);
    column-gap: 4rem;
  }

  .section > .label { padding-top: 0.7rem; }
  .section--page > .label { padding-top: 1.35rem; }
  .section > .steps { grid-column: 1 / -1; }
}

/* Process steps */
.steps {
  display: grid;
  gap: 1.75rem;
  margin: clamp(1rem, 3vw, 2rem) 0 0;
  padding: 0;
  list-style: none;
}

.step {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  column-gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.step-number {
  grid-row: 1 / span 2;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 2.75rem;
  line-height: 0.95;
}

.step h3 {
  grid-column: 2;
  margin-bottom: 0.5rem;
  font-size: 1.375rem;
  line-height: 1.2;
}

.step p {
  grid-column: 2;
  font-size: 1rem;
}

@media (min-width: 56rem) {
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3rem;
  }

  .step { display: block; }

  .step-number {
    display: block;
    margin-bottom: 1rem;
    font-size: 3.5rem;
  }

  .step h3 { margin-bottom: 0.75rem; }
}

/* ==========================================================================
   Home: portfolio manager
   ========================================================================== */
.profile {
  display: grid;
  align-items: center;
  gap: 2rem;
  padding-block: var(--space-section);
  border-top: 1px solid var(--rule);
}

.profile .photo {
  width: min(100%, 18rem);
  aspect-ratio: 4 / 5;
}

.profile h2 {
  margin-top: 0.5rem;
  font-size: var(--text-name);
}

/* On wide screens the portrait sits on the right, so that he faces the text */
@media (min-width: 48rem) {
  .profile {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(2.5rem, 6vw, 5rem);
  }

  .profile .photo {
    order: 2;
    justify-self: end;
    width: 100%;
    max-width: 26rem;
  }
}

/* ==========================================================================
   Home: the difference — three points, each a run-in label and its text
   ========================================================================== */
.points {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0 0;
}

.points > div {
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.points dt {
  display: inline;
  font-weight: 700;
}

.points dd {
  display: inline;
  margin: 0;
}

/* ==========================================================================
   Home: closing call to action
   ========================================================================== */
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 3rem;
  padding-block: var(--space-section);
  border-top: 1px solid var(--rule);
}

.cta h2 {
  margin: 0;
  font-size: var(--text-name);
}

/* ==========================================================================
   Contact: the form
   ========================================================================== */
.form {
  display: grid;
  gap: 1.25rem;
  max-width: 40rem;
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
}

.form-row {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 36rem) {
  .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  color: var(--ink-soft);
  font-size: var(--text-label);
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.field .optional {
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: none;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--field);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 0.2s ease;
}

.field textarea {
  min-height: 9rem;
  line-height: 1.55;
  resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--ink-soft); }

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  border-color: var(--ink);
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

/* A field left for spam robots to fill in; people never see it */
.trap {
  position: absolute;
  left: -200vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  max-width: none;
  margin: 0;
  padding: 0.9rem 1rem;
  border-left: 2px solid var(--ink);
  background: var(--field);
}

/* The confirmation shown in place of the form once a message is sent */
.sent {
  max-width: 40rem;
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border-left: 2px solid var(--ink);
  background: var(--field);
}

.sent:focus { outline: none; } /* focus is moved here by the script, not by the visitor */

.sent-title {
  margin: 0.5rem 0 1rem;
  font-size: var(--text-title);
}

.sent-email { overflow-wrap: anywhere; }

.sent-sign {
  margin-top: 1.25rem;
  font-size: var(--text-lede);
  font-style: italic;
}

.text-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  cursor: pointer;
}

.text-button:hover { text-decoration-thickness: 2px; }

/* ==========================================================================
   Resources: the list of documents
   ========================================================================== */
.documents {
  max-width: 46rem;
  margin: clamp(1.75rem, 4vw, 2.75rem) 0 0;
  padding: 0;
  border-bottom: 1px solid var(--rule);
  list-style: none;
}

.documents li { border-top: 1px solid var(--rule); }

.documents a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 1.25rem 0.5rem;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.documents a:hover { background: var(--field); }

/* A row reached from a footer link is highlighted on arrival */
.documents li:target a,
.documents li.is-target a { background: var(--panel); }

.doc-title {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  line-height: 1.2;
}

.doc-meta {
  color: var(--ink-soft);
  font-size: var(--text-label);
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ==========================================================================
   Privacy policy and other plain text pages
   ========================================================================== */
.prose { margin-top: clamp(1.25rem, 3vw, 2rem); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  padding-block: clamp(2.5rem, 6vw, 4rem) 2rem;
  border-top: 1px solid var(--rule);
  font-size: var(--text-small);
  line-height: 1.65;
}

.footer-main {
  display: grid;
  gap: 2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.footer-brand .brand-mark { width: 3rem; }

.footer-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.2;
}

.disclosure { color: var(--ink-soft); }

.footer-nav ul {
  display: grid;
  gap: 0 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  display: inline-block;
  padding-block: 0.45rem;
}

/* The page you are on is shown without an underline */
.footer-nav a[aria-current="page"] { text-decoration: none; }

.footer-separator {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ink);
  color: var(--ink-soft);
}

.footer-separator p { margin: 0; }

@media (min-width: 30rem) {
  .footer-nav ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 56rem) {
  .footer-main {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 4rem;
  }
}

/* ==========================================================================
   Motion preference
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after { transition: none !important; }
}
